Subject: Re: [boost] [UTF String] UTF String library 1.5 ready for perusal
From: Chad Nelson (chad.thecomfychair_at_[hidden])
Date: 2011-02-10 19:21:04
On Thu, 10 Feb 2011 21:19:49 +0000
"Phil Endecott" <spam_from_boost_dev_at_[hidden]> wrote:
> [...] So I have one comment on this exchange:
>>> Iterating through code points is fully generic and should work for
>>> any forward iterator or bidirectional iterator, not just a pointer.
>> I could make it fully generic, but it wouldn't be nearly as efficient
>> that way. I chose to do the extra work to make it efficient.
> I have to challenge your efficiency comment. I have UTF-8 encoding
> and decoding that works with generic iterators, including pointers,
> and I have no efficiency issues resulting from its genericity. In
> fact I spent some time carefully optimising it and I believe that when
> used with pointers it is as good as I could get by writing it in
You may well be right, for your UTF-8-only code. For my design, it was
more efficient to create separate iterators for UTF-8, UTF-16, and
UTF-32 than to try to make one completely generic UTF-anything
iterator. That's what I meant by "fully generic."
-- Chad Nelson Oak Circle Software, Inc. * * *
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk