From 986ec16eccae61113095f2472fa240fcf05fb29a Mon Sep 17 00:00:00 2001 From: Alexander Nasonov Date: Tue, 16 Jan 2007 21:53:27 +0000 Subject: [PATCH] Fix [ 1358600 ] lexical_cast & pure virtual functions & VC 8 STL [SVN r36739] --- include/boost/detail/lcast_precision.hpp | 29 ++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/include/boost/detail/lcast_precision.hpp b/include/boost/detail/lcast_precision.hpp index dad5dc6..9b785cd 100644 --- a/include/boost/detail/lcast_precision.hpp +++ b/include/boost/detail/lcast_precision.hpp @@ -15,6 +15,10 @@ #include #include +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) // VC++ 8.0 +#include +#endif + #ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS #include #else @@ -23,6 +27,27 @@ namespace boost { namespace detail { +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) + +template struct lcast_msvc_limits; + +template +struct lcast_msvc_limits + : std::numeric_limits +{ +}; + +// Non-abstract class that does define a specialization of numeric_limits: +class lcast_msvc_without_limits {}; + +template +struct lcast_msvc_limits + : std::numeric_limits +{ +}; + +#endif // VC++ workaround + #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS // Calculate an argument to pass to std::ios_base::precision from // lexical_cast. See alternative implementation for broken standard @@ -30,7 +55,11 @@ namespace boost { namespace detail { template struct lcast_precision { +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) + typedef lcast_msvc_limits::value)> limits; +#else typedef std::numeric_limits limits; +#endif BOOST_STATIC_CONSTANT(bool, use_default_precision = !limits::is_specialized || limits::is_exact