And you can't simply assign from a case sensitive basic_string to a insensitive basic_string, you'll have to use iterators (src.begin() and back_inserter(target)) and the copy algorithm.