c++ - std::basic_string specialization -


i need override length function std::basic_string because it's not correct custom char type on specific platform. current declaration for, let's say, customstring

typedef stl::basic_string<customchar, stl::char_traits<customchar>, stl::allocator<customchar> > customstring; 

i need have class behaves customstring, length function changed.

you need specialise std::char_traits structure , override static size_t length(const char_type* s); function that.

then don’t need specify template parameters when instantiating basic_string. following definition should enough:

typedef std::basic_string<customchar> customstring; 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -