
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? -- Maxim Yegorushkin

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

On Mon, 20 Jun 2005 17:31:45 +0400, Andrey Melnikov <melnikov@simplexsoft.com> wrote: []
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".
Yes, exactly for 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.
Got it. Thanks. -- Maxim Yegorushkin

Maxim Yegorushkin <e-maxim <at> yandex.ru> writes:
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?
Are you suggesting to move in numeric/conversion direction? http://www.boost.org/libs/numeric/conversion/doc/index.htmlx -- Alexander Nasonov

On Tue, 21 Jun 2005 11:52:06 +0400, Alexander Nasonov <alnsn-boost@yandex.ru> wrote:
Maxim Yegorushkin <e-maxim <at> yandex.ru> writes:
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?
Are you suggesting to move in numeric/conversion direction? http://www.boost.org/libs/numeric/conversion/doc/index.htmlx
Probably not. I most interested in fast string -> integer conversions. If I got it right, the Numeric Conversion Library was created with some other intent. -- Maxim Yegorushkin

Maxim Yegorushkin <e-maxim <at> yandex.ru> writes:
Are you suggesting to move in numeric/conversion direction? http://www.boost.org/libs/numeric/conversion/doc/index.htmlx
Probably not.
Sorry for being cryptic. I had in mind missing nodes X and Y on this diagram: numeric_cast -> numeric/conversion -> boost::numeric::converter lexical_cast -> X -> Y According to common sense, X should be lexical/conversion and Y should be boost::lexical::converter. Do you need something similar? -- Alexander Nasonov

On Wed, 22 Jun 2005 13:40:46 +0400, Alexander Nasonov <alnsn-boost@yandex.ru> wrote: []
Sorry for being cryptic. I had in mind missing nodes X and Y on this diagram:
numeric_cast -> numeric/conversion -> boost::numeric::converter lexical_cast -> X -> Y
According to common sense, X should be lexical/conversion and Y should be boost::lexical::converter. Do you need something similar?
Exactly. I've attached a source where that converter is lex_caster<>. -- Maxim Yegorushkin
participants (3)
-
Alexander Nasonov
-
Andrey Melnikov
-
Maxim Yegorushkin