
From: "Tom Matelich"
I'm going to embark on it, but I thought I'd ask in parallel. One of
"Terje Slettebø"
things about Terje's proposed lexical_cast was a lot of documentation of how to specialize it. That doesn't seem to be addressed in 1.30.0's version.
<snip>
However, one can still simply overload/specialise the lexical_cast
function
template, to get the same effect, even though this is not documented. It's similar to being able to specialise components in the standard library. I think this is a simpler way of doing it than the earlier way.
For example:
#include
namespace boost { template<> double lexical_cast<double>(const std::string &source) { // ... } }
This barfs under my compiler (BCB4/Win32), since you can't specialize a function template. From what little investigation I've done so far, it seems that the best place to do this specialization is in the boost::detail::lexical_stream class, such as the specialization already done for extracting a std::string from the lexical_stream. -- Corey Murtagh The Electric Monk "Quidquid latine dictum sit, altum viditur!"