Boost logo

Boost :

Subject: Re: [boost] [General] Always treat std::strings as UTF-8
From: Mostafa (mostafa_working_away_at_[hidden])
Date: 2011-01-19 22:27:05


On Wed, 19 Jan 2011 18:44:44 -0800, Chad Nelson
<chad.thecomfychair_at_[hidden]> wrote:

> On Wed, 19 Jan 2011 14:32:31 -0800
> Mostafa <mostafa_working_away_at_[hidden]> wrote:
>
>>> operator* has a long history of providing the contents of a variable,
>>> even in C, and is a lot less typing to boot. But if you have any
>>> technical arguments against it, I'm listening.
>>
>> Can we stick to std::string conventions as closely as possible? It
>> makes using whatever new string library that much easier, and clearer,
>> and maintainable.
>
> Is there a conventional way to get the data stored in an std::string? ;-)
>

std::string::c_str, or am I missing something? (BTW, that's why I
suggested utf8_t::cu_str, sounds similar.)

>> I'm a big fan of conveying your intent in code. For the same reason
>> I strong disagree with utf8_t::str. utf8_t is already a string class,
>> and a generic sounding "str" method off it doesn't convey what kind of
>> string it returns.
>
> While that's true (and I'm not a fan of str() in this context either),
> it does have the advantage of implying that it returns an std::string,
> based on the conventions of std::stringstream.

I would argue utf8_t is analagous to std::string, not std::stringstream.
Ones in the storage category, the others in the streaming category.

Mostafa


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