
From: "Tom Matelich" <tmatelich@zetec.com>
I'm going to embark on it, but I thought I'd ask in parallel. One of
"Terje Slettebø" <tslettebo@chello.no> wrote in message news:031b01c2fc98$f1065db0$8d6c6f50@pc... the
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 <boost/lexical_cast.hpp>
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!"