Inheriting and overriding functions of a std::string?

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.

Leave a Comment