
4 Dec
2008
4 Dec
'08
10:27 a.m.
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