Boost logo

Boost :

Subject: Re: [boost] lexical_cast optimization
From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2008-12-04 05:27:02


David Abrahams <dave <at> boostpro.com> writes:

> Someone was asking me today about the inefficiency of lexical_cast for
> its common itoa/atoi-like usage, and it occurred to me that it could
> *easily* be optimized to handle the common cases by dispatching to
> itoa/atoi ftoa/atof where available, and even sprintf. Seems like a
> great idea to me.

This can be easily done only if a program always uses the classic C and C++
locales. Optimization for some combinations of types is already available if
you set BOOST_LEXICAL_CAST_ASSUME_C_LOCALE.

Mapping between C and C++ locales is hard, if possible at all in a portable way.

--
Alex

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