Boost logo

Boost :

Subject: Re: [boost] [string] Realistic API proposal
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2011-01-29 13:56:47


On 29/01/2011 05:12, Joe Mucchiello wrote:
>>>> // UTF validation
>>>>
>>>> bool is_valid_utf() const;
>>>
>>> See, that's what makes the whole thing pointless.
>>
>> Actually not, consider:
>>
>> socket.read(my_string);
>> if(!my_string.is_valid_utf())
>> ....
>
> This, and many of these functions, work much better as standalone functions:
>
> // with a string-aware function
> socket.read(my_string);
> if (!is_valid_utf8(my_string.begin(),my_string.end())) ....

or if(!is_valid_utf8(my_string))


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