
16 Mar
2005
16 Mar
'05
7:56 p.m.
Thorsten Ottosen wrote:
Ok, so basic_string< char, char_trait<char>, allocator<char> > makes assumptions. So what, I was implying that you should write a specialization
basic_string< char, utf_traits<char>, allocator<char> >:
template< class T, class UTF > class basic_string<T,utf_traits<UTF>,std::allocator<T> > { public: basic_string() { } ... };
typedef basic_string< char, utf_traits<utf8> > utf8_string;
What is it you wouldn't be able to do with this interface?
because (for example) std::basic_string provides random access to its data (i.e. characters), and that implies a fixed-size character type, which not all unicode encodings provide. Regards, Stefan