Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2006-04-11 07:44:03


"Reece Dunn" <msclrhd_at_[hidden]> writes:

> Maxim Yegorushkin wrote:
>> On 4/11/06, Reece Dunn <msclrhd_at_[hidden]> wrote:
>>
>> []
>>
>> > The string_to<T> function could have basic_string and wstring overloads, but this would be inconsistent with the rest of the C++ library.
>>
>> I don't like the idea of the user having to convert whichever string
>> he happens to use to std::basic_string just to do the conversion.
>
> The overloaded version would look something like:
>
> T string_to<T>( const std::string & )
> T string_to<T>( const std::wstring & )
> T string_to<T>( const std::basic_string< CharT, CharTraits, Allocator > & )
>
> whereas, to be more consistent with the rest of the standard
> library, you would have something like:
>
> T string_to<T>( const std::string & )
> T wstring_to<T>( const std::wstring & )
> T basic_string_to<T>( const std::basic_string< CharT, CharTraits, Allocator > & )

I'm not sure consistency is a virtue in this case.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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