Boost logo

Boost-Commit :

From: joaquin_at_[hidden]
Date: 2007-10-18 02:57:26


Author: joaquin
Date: 2007-10-18 02:57:25 EDT (Thu, 18 Oct 2007)
New Revision: 40146
URL: http://svn.boost.org/trac/boost/changeset/40146

Log:
applied workaround for MSVC++ 6.5/7.0 problem with static constants inside templates, see http://lists.boost.org/Archives/boost/2007/10/128392.php
Text files modified:
   trunk/boost/detail/lcast_precision.hpp | 12 +++++++++---
   trunk/boost/lexical_cast.hpp | 4 ++--
   2 files changed, 11 insertions(+), 5 deletions(-)

Modified: trunk/boost/detail/lcast_precision.hpp
==============================================================================
--- trunk/boost/detail/lcast_precision.hpp (original)
+++ trunk/boost/detail/lcast_precision.hpp 2007-10-18 02:57:25 EDT (Thu, 18 Oct 2007)
@@ -21,7 +21,13 @@
 #include <boost/type_traits/is_abstract.hpp>
 #endif
 
-#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || \
+ (defined(BOOST_MSVC) && (BOOST_MSVC<1310))
+
+#define BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+#endif
+
+#ifdef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
 #include <boost/assert.hpp>
 #else
 #include <boost/static_assert.hpp>
@@ -31,7 +37,7 @@
 
 class lcast_abstract_stub {};
 
-#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
 // Calculate an argument to pass to std::ios_base::precision from
 // lexical_cast. See alternative implementation for broken standard
 // libraries in lcast_get_precision below. Keep them in sync, please.
@@ -92,7 +98,7 @@
 template<class T>
 inline std::streamsize lcast_get_precision(T* = 0)
 {
-#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
+#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
     return lcast_precision<T>::value;
 #else // Follow lcast_precision algorithm at run-time:
 

Modified: trunk/boost/lexical_cast.hpp
==============================================================================
--- trunk/boost/lexical_cast.hpp (original)
+++ trunk/boost/lexical_cast.hpp 2007-10-18 02:57:25 EDT (Thu, 18 Oct 2007)
@@ -307,7 +307,7 @@
 #undef BOOST_AUX_LEXICAL_CAST_DEF
 #undef BOOST_AUX_LEXICAL_CAST_DEF1
 
-#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
 // This #if is in sync with lcast_precision
 
         // Helper for floating point types.
@@ -376,7 +376,7 @@
     };
 
 #endif // #ifndef DISABLE_WIDE_CHAR_SUPPORT
-#endif // #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+#endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
     }
 
     namespace detail // '0' and '-' constants


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk