Refactoring basic_string_assign().