Boost logo

Boost :

Subject: Re: [boost] [convert] Boost.Convert Library Review
From: Michael Fawcett (michael.fawcett_at_[hidden])
Date: 2011-05-02 11:57:26


On Mon, May 2, 2011 at 11:39 AM, Gordon Woodhull <gordon_at_[hidden]> wrote:
>
> On May 2, 2011, at 10:58 AM, Stewart, Robert wrote:
>> If lexical_cast can be extended, then I think most of the features of this library should be made part of lexical_cast, but that would preclude the optimized conversions I suggested earlier (when one can forgo locales and manipulators).  Thus far, history has indicated that such changes are not welcome, making a library like Boost.Convert necessary.
>
> Along with Vladimir, I'd really like to kill this line of reasoning.  Here's Kevlin's rationale, quoted in some earlier discussion.  (It seems to have disappeared from the lexical_cast documentation since then.)
>
> http://lists.boost.org/Archives/boost/2005/04/84917.php
>> - It is also worth mentioning future non-directions: anything that involves adding extra arguments for a conversion operation is not being considered. A custom keyword cast, such as lexical_cast, is intended to look like a built-in cast operator: built-in cast operators take only a single operand.
>
> I actually find that pretty convincing, although I'd like to see something that looks as close to lexical_cast as possible.

I would also like to voice my support of Vladimir. Parsing XML or
properties files is tremendously slow using lexical_cast because of
all the exceptions when all you want is a default value if something
is missing. We've been down this road before, discussing extending
lexical_cast and it went nowhere for a decent reason. So Vladimir's
only choice was to make Convert, yet people are still voting No over
this.

--Michael Fawcett


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