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

[SVN r40146]
This commit is contained in:
Joaquín M López Muñoz
2007-10-18 06:57:25 +00:00
parent b9a7ee6deb
commit 0d6a924f94
2 changed files with 11 additions and 5 deletions

View File

@@ -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 @@ namespace boost { namespace detail {
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 @@ struct lcast_precision
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:

View File

@@ -307,7 +307,7 @@ namespace boost
#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 @@ namespace boost
};
#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