Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73201 - in trunk/boost: numeric/conversion/detail type_traits
From: antoshkka_at_[hidden]
Date: 2011-07-17 15:36:07


Author: apolukhin
Date: 2011-07-17 15:36:06 EDT (Sun, 17 Jul 2011)
New Revision: 73201
URL: http://svn.boost.org/trac/boost/changeset/73201

Log:
Fixes #5707. Fixes some trivial bugs for VC++6
Text files modified:
   trunk/boost/numeric/conversion/detail/old_numeric_cast.hpp | 11 +++++++----
   trunk/boost/type_traits/add_rvalue_reference.hpp | 6 ++----
   trunk/boost/type_traits/is_unsigned.hpp | 2 +-
   trunk/boost/type_traits/remove_cv.hpp | 3 ++-
   4 files changed, 12 insertions(+), 10 deletions(-)

Modified: trunk/boost/numeric/conversion/detail/old_numeric_cast.hpp
==============================================================================
--- trunk/boost/numeric/conversion/detail/old_numeric_cast.hpp (original)
+++ trunk/boost/numeric/conversion/detail/old_numeric_cast.hpp 2011-07-17 15:36:06 EDT (Sun, 17 Jul 2011)
@@ -8,6 +8,7 @@
 // See http://www.boost.org/libs/conversion for Documentation.
 
 // Revision History
+// 16 Jul 11 Bugfixes for VC6.
 // 23 JUN 05 Code extracted from /boost/cast.hpp into this new header.
 // Keeps this legacy version of numeric_cast<> for old compilers
 // wich can't compile the new version in /boost/numeric/conversion/cast.hpp
@@ -52,6 +53,7 @@
 # include <boost/type.hpp>
 # include <boost/limits.hpp>
 # include <boost/numeric/conversion/converter_policies.hpp>
+# include <boost/mpl/if.hpp>
 
 // It has been demonstrated numerous times that MSVC 6.0 fails silently at link
 // time if you use a template function which has template parameters that don't
@@ -95,10 +97,11 @@
       // Move to namespace boost in utility.hpp?
       template <class T, bool specialized>
       struct fixed_numeric_limits_base
- : public if_true< std::numeric_limits<T>::is_signed >
- ::BOOST_NESTED_TEMPLATE then< signed_numeric_limits<T>,
- std::numeric_limits<T>
- >::type
+ : public BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c<
+ std::numeric_limits<T>::is_signed,
+ BOOST_DEDUCED_TYPENAME signed_numeric_limits<T>,
+ BOOST_DEDUCED_TYPENAME std::numeric_limits<T>
+ >::type
       {};
 
       template <class T>

Modified: trunk/boost/type_traits/add_rvalue_reference.hpp
==============================================================================
--- trunk/boost/type_traits/add_rvalue_reference.hpp (original)
+++ trunk/boost/type_traits/add_rvalue_reference.hpp 2011-07-17 15:36:06 EDT (Sun, 17 Jul 2011)
@@ -39,15 +39,13 @@
     struct add_rvalue_reference_helper
     { typedef T type; };
 
+#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
     template <typename T>
     struct add_rvalue_reference_helper<T, true>
     {
-#if !defined(BOOST_NO_RVALUE_REFERENCES)
         typedef T&& type;
-#else
- typedef T type;
-#endif
     };
+#endif
 
     template <typename T>
     struct add_rvalue_reference_imp

Modified: trunk/boost/type_traits/is_unsigned.hpp
==============================================================================
--- trunk/boost/type_traits/is_unsigned.hpp (original)
+++ trunk/boost/type_traits/is_unsigned.hpp 2011-07-17 15:36:06 EDT (Sun, 17 Jul 2011)
@@ -109,7 +109,7 @@
 template <> struct is_unsigned_imp<volatile char> : public true_type{};
 template <> struct is_unsigned_imp<const volatile char> : public true_type{};
 #endif
-#if defined(WCHAR_MIN) && (WCHAR_MIN == 0)
+#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
 template <> struct is_unsigned_imp<wchar_t> : public true_type{};
 template <> struct is_unsigned_imp<const wchar_t> : public true_type{};
 template <> struct is_unsigned_imp<volatile wchar_t> : public true_type{};

Modified: trunk/boost/type_traits/remove_cv.hpp
==============================================================================
--- trunk/boost/type_traits/remove_cv.hpp (original)
+++ trunk/boost/type_traits/remove_cv.hpp 2011-07-17 15:36:06 EDT (Sun, 17 Jul 2011)
@@ -27,6 +27,8 @@
 
 namespace boost {
 
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
 namespace detail{
 
 template <class T>
@@ -49,7 +51,6 @@
 
 }
 
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
 // convert a type T to a non-cv-qualified type - remove_cv<T>
 BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename boost::detail::rvalue_ref_filter_rem_cv<T>::type)


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