Boost logo

Boost :

From: Alexander Nasonov (alnsn_at_[hidden])
Date: 2007-11-26 05:21:28


Joaquín Mª López Muñoz <joaquin <at> tid.es> writes:
> The problem with rev 41387 is *not* that non-standard traits aren't supported
> for legacy compilers, but that lexical_cast is simply broken for such
> compilers, any code that used to use lexical_cast won't compile now , it's
> not about new features in boost::lexical_cast.

I didn't realise it's broken. Can you please try this change?

template<typename Target, typename Source>
Target lexical_cast(Source arg)
{
    typedef typename detail::widest_char<
        typename detail::stream_char<Target>::type
      , typename detail::stream_char<src>::type
>::type char_type;

    typedef std::char_traits<char_type> traits;
    detail::lexical_stream<Target, Source, traits> interpreter;
    Target result;
    ...
}

Most notably, Boost.Test uses lexical_cast internally, so any lib that uses
> Boost.Test with a legacy compiler is now broken (this is actually my case.)

I hate this dependency between Boost.Test and lexical_cast_test which is based
on it.

> Unless you want to ban every usage of lexical_cast in MSVC++ 6.0/7.0 and
> compilers without PTS, wouldn't be possible to provide some standard
> traits class in the usage of lexical_stream at line 1183 so as to not break
> legacy code?

Sure. If the code above won't work, you'll have to wait approx 12 hours
for the fix. I don't have an access to old MSVC so I'm going to
-DBOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION and see what it breaks.

--
Alexander

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk