Boost logo

Boost :

Subject: Re: [boost] Formal Review Request: Boost.String.Convert
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2009-02-17 14:39:29


On Tue, Feb 17, 2009 at 11:19 AM, Andrey Semashev
<andrey.semashev_at_[hidden]> wrote:
> The outcome was that to_string/from_string are not verbs, are slightly
> longer than convert and duplicate the namespace name; to/from are
> meaningless without the surrounding namespace name, which may be omitted or
> mangled with aliases.

Are you saying that

boost::string::to(x)

reads better than

boost::to_string(x)?

>> 2) What's the motivation for the convert function? Is it supposed to
>> convert anything to anything? (It seems to me the motivation is to
>> mimic the lexical_cast functionality but I don't think that's
>> necessary.)
>
> The convert function will eventually convert different things to strings and
> vice versa.

You can convert different things to string using to_string. You can
convert different things from strings using from_string.

My question is, what is the motivation for the convert function?
What's the use case for it that doesn't work with
to_string/from_string?

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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