|
Boost Users : |
From: Electric Monk (yg-boost-users_at_[hidden])
Date: 2003-04-06 20:41:30
"Terje Slettebų" <tslettebo_at_[hidden]> wrote in message
news:031b01c2fc98$f1065db0$8d6c6f50_at_pc...
> >From: "Tom Matelich" <tmatelich_at_[hidden]>
>
> > I'm going to embark on it, but I thought I'd ask in parallel. One of
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!"
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net