         }
     }
     subscript(range: Range<String.CharacterView.Index>) -> String {
-        get { return String(self.characters[range]) }
-        set {
-            var chars = self.characters
-            chars.replaceSubrange(range, with: newValue.characters)
-            self = String(chars)
-        }
+        @warn_unused_result get { return String(self.characters[range]) }
+        set { self.characters.replaceSubrange(range, with: newValue.characters) }
     }
     
     func getIndex(_ v: Int) -> Index {

    return res
}

// implementation of the * operator on String and UInt to concatonate a String to itself multiple times
// and directly assigning it to the String
//
// @param           right   : UInt - how many times (-1) the string should be concatonated to itself ( 0 means "" )
// @param   inout   left    : String - the string to concatonate to itself, will be assigned to this variable (inout ;-) )
// @result                  : String - the concatonated string


func *= ( left: inout String, right: UInt) -> String {
    if right == 0 {

        return i
    }
    
    func getIndexRange(_ r: CountableRange<Int>) -> Range<Index> {
        let start = getIndex(r.lowerBound)
        var end = start
        let endRange = min(r.count - 1, self.characters.count - r.lowerBound - 1)
        guard endRange >= 0 else { return start..<start }
        for _ in 0...endRange { end = index(after: end) }
        return start..<end
    }
    
    
    subscript(index: Int) -> Character {
        @warn_unused_result get { return self[getIndex(index)]            }
                            set {        self[getIndex(index)] = newValue }
    }
    
    subscript(range: CountableRange<Int>) -> String {
        @warn_unused_result get { return self[getIndexRange(range)]            }
                            set {        self[getIndexRange(range)] = newValue }
    }

}
