Since std::string
is actually a typedef
of a templated class, how can I override it? I want to make a UTF-8 std::string
that will return the correct length, among other things.
Since std::string
is actually a typedef
of a templated class, how can I override it? I want to make a UTF-8 std::string
that will return the correct length, among other things.
If you must define your own string type, then don't inherit from std::string
but define your own Character Traits class and do something like
typedef std::basic_string<unsigned char, utf8_traits> utf8string;
See also Herb Sutter's website.