Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: Boost.String.Convert
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2009-02-18 12:26:57


Emil Dotchevski wrote:

>>> to_string doesn't need a template parameter.
>> Actually, it does, since I might want different string types to get. Right
>> now there are string and wstring, and more are coming in C++0x.
>
> I've needed to convert things specifically to std::string plenty of
> times to justify a simple interface where to_string returns
> std::string. I want to be able, in a header file, to just say:
>
> struct foo;
> std::string to_string( foo const & );
> std::string to_string( foo const &, fmt );
>
> and be done with it.

That simplification as absolutely not acceptable for me, as I convert to
wstring just about as often as to string. I think that the library
should provide flexibility in this aspect. You can create a tiny wrapper
around it, if you only need narrow strings.


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