The implementation of these functions used the expression: return {1, 'x'}; This call the initializer list constructor of basic_string. Which lead to two char strings. This changes the expression to: return {'x'};