Boost logo

Boost :

From: Stefan Seefeld (seefeld_at_[hidden])
Date: 2005-03-16 14:56:51


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk