> From: Peter Dimov [mailto:pdimov@mmltd.net]
>
> Why not make the specialization of lexical_cast use to_string? :-)
>
> What is the difference? The point is that I need a "value to string"
> facility, that works, now, on compilers without partial
> specialization.
>

I think lexical_cast should indeed use to_string - to_string doesn't need the "default" conversion provided by lexical_cast;  to_string is the "primitive" that should be added to lexical_cast.

Furthermore, if we have to_string, we could easily make lexical_cast work correctly by using the sizeof-trick or (which I think would be better) by using interpreter_traits to help select the correct implementation.

No partial specialization needed and a working lexical_cast that reuses to_string.

There were some arguments against to_string (with regards to possibilities for enhancement of lexical_cast), but surely the above would do the trick?


Bjorn