Boost logo

Boost :

From: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2008-02-26 15:52:17


Sebastian Redl wrote:
> Phil Endecott wrote:
>> OK, the code is here:
>> http://svn.chezphil.org/libpbe/trunk/include/charset/
>>
> Playing around with implementing a very simple immutable string with
> shared representation based on the concepts, and I found that your
> current charset traits cannot deal with shift encodings. Basically, you
> miss the shift state in all relevant functions:
> skip_forward/backward_char, encode, decode and char_length.

My original hope was that only the actual conversion function would
need to track the shift state, while the decoding of the units would be
independent of it. Unfortunately this isn't true of, for example,
iso-2022; you need to track the shift state to know whether you're
looking at a 1-byte or a 2-byte character. So, yes, this interface
will need to change.

> Also, const_unit_ptr_t is not a very good template parameter name. It's
> misleading, since the user might assume the type has to be a pointer,
> where an iterator suffices.

True. I'm sure you'll find many more such issues.

Thanks for the feedback.

Phil.


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