Boost logo

Boost :

Subject: Re: [boost] [lexical_cast] Volunteer testers needed
From: Adam Badura (abadura_at_[hidden])
Date: 2009-06-13 13:24:41


> I would prefer it's named boost::classic::lexical_cast but I'm not sure
> what
> is the policy in other boost libraries (Spirit classic comes to mind but
> it's classic in a some other way :)

    I don't know it either and I have no strong feelings to this name so I
can be changed if desired.

> Also, it would be more efficient to use NULL p_loc for classic rather than
> &std::locale::classic() because you could turn
>
> #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
> ...
> #endif
>
> into
>
> if(p_loc) {
> ...
> }

    Yes. But first of all it would require to use &std::locale() as global
locale in place of current NULL. This would mean that a copy of the locale
has to be done each time lexical_cast is called. And although copying
std::locale objects should be simple it still is some overhead compared to
original version which did not do this. Also time of acquisition of the
global locale object would be different the in the original version of
lexical_cast. I think that in good written code it should not matter.
However I preferred to introduce as few changes to the original lexical_cast
as possible so I chose NULL to mean global locale instead of classic one.

    Adam Badura


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