Boost logo

Boost :

Subject: Re: [boost] [review] Convert library
From: Thijs (M.A.) van den Berg (thijs_at_[hidden])
Date: 2014-05-25 10:59:09


On May 25, 2014, at 2:47 PM, Roland Bock <rbock_at_[hidden]> wrote:

> I think it would be relatively simple to get to a much leaner interface.
> For instance,
>
> * convert could have a converter template parameter, defaulting to the
> stringstream converter
> * convert::from() could have an overload that just takes the "from"
> parameter and provides the default-constructed converter itself.

In C++11 has std::to_string and various flavours of stoul, stoull, stof. To me it makes more sense to use those for conversions between strings and integral types. Not just because of portability, but also because the interface is so simple.

The value of convert to me seems to be more in the context of generic programming for a wide range of types with a uniform interface than for a simple interface for specific types for which there are already simple & standard alternatives.


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