Boost logo

Boost :

From: Andrey Melnikov (melnikov_at_[hidden])
Date: 2005-06-20 08:31:45


Maxim Yegorushkin wrote:
> I'd like to be able to specialize lexical_cast for certain source->target
> conversions. With its current design I see no possibility to do that as
> function templates can not be partially specialized. Are the any plans to
> change that?
>

Did you mean partial, or simply explicit specialization?

For what do you need specialization? If you need it for extensibility,
current framework is already extensible through definition of << and >>
operators.

If you need it for performance, we had a discussion about lexical_cast
performance issues some time ago in thread named "lexical_cast with
default value", and I googled other discussions too by searching for
"lexical_cast performance".

We weren't able to provide enough arguments for such specialization, and
ended with a need for fast numeric conversion library which won't be
related to lexical_cast at all.

For performance reasons I use the patch I described in
http://lists.boost.org/boost/2005/05/26031.php to allow specialization.

Andrey


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