Boost logo

Boost :

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


Emil Dotchevski wrote:

>>> (Though as it is evident, you'll still have hard time convincing me
>>> that when all I need is to convert a foo to std::string, I have to use
>>> "the mother of all conversions" library instead of the straight
>>> forward to_string.)
>> Perhaps. I still don't understand why would you want to use specific
>> functions, like to_string/to_wstring/to_whatever_string(foo) instead of a
>> unified interface function convert< whatever >(foo).
>
> The answer is the same as why I don't always use templates. I use
> templates when I need my code to be generic, otherwise I do not.

That's an odd argument. You do use STL containers in a non-template
code, don't you? And perhaps you use shared_ptr< T > in a non-template
code, too? The lexical_cast< T > may be a closer example. How come
convert< T > to be that special?

> If I want to convert to T I'll use convert<T> if I want to convert to
> string, I prefer the much lighter s=to_string(x).

Well, at this point it's not obvious how much lighter it is (and even if
it is lighter at all).


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