Boost logo

Boost :

Subject: Re: [boost] [strings][unicode] Proposals for Improved String Interoperability in a Unicode World
From: Beman Dawes (bdawes_at_[hidden])
Date: 2012-01-31 10:33:41


On Mon, Jan 30, 2012 at 12:00 PM, Yakov Galka <ybungalobill_at_[hidden]> wrote:
> On Sun, Jan 29, 2012 at 17:52, Beman Dawes <bdawes_at_[hidden]> wrote:
>...
>> While I'm totally convinced that conversion iterators would be very
>> useful, the exact form is an open question.  Could you be more
>> specific about the details of your convert suggestion?
>>
>
> The point is that it's more like a free-standing c_str() you proposed.
> Unlike c_str() member function it would work on any character range, and
> returns a range of converting iterators. We don't need to extent
> basic_string for this, which is already too big.

The only way I can see that work with a totally unchanged basic_string
would involve a temporary, which I was trying to avoid. Although with
move semantics the temporary isn't as expensive as is used to be.

If basic_string changed to accept range templates (which others may
propose), a free-function approach would work (pending the details of
the range proposal).

If basic_string changed to accept single iterator templates, a
free-function conversion iterator generator approach would work.

I've added these three alternative solutions to the paper, and given
you credit in the acknowledgments. Thanks!

See http://beman.github.com/string-interoperability/tr2-proposal.html

--Beman


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