Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73169 - sandbox/conversion/boost/conversion/type_traits
From: vicente.botet_at_[hidden]
Date: 2011-07-17 06:54:06


Author: viboes
Date: 2011-07-17 06:54:05 EDT (Sun, 17 Jul 2011)
New Revision: 73169
URL: http://svn.boost.org/trac/boost/changeset/73169

Log:
conversion: fix is_move_xxx on compilers don't supporting rvalue references.
take care of unbound arrays
Text files modified:
   sandbox/conversion/boost/conversion/type_traits/is_copy_assignable.hpp | 2 ++
   sandbox/conversion/boost/conversion/type_traits/is_copy_constructible.hpp | 4 ++--
   sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp | 20 +++++++++++++++++++-
   sandbox/conversion/boost/conversion/type_traits/is_move_constructible.hpp | 21 ++++++++++++++++++---
   4 files changed, 41 insertions(+), 6 deletions(-)

Modified: sandbox/conversion/boost/conversion/type_traits/is_copy_assignable.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_copy_assignable.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_copy_assignable.hpp 2011-07-17 06:54:05 EDT (Sun, 17 Jul 2011)
@@ -44,6 +44,8 @@
    */
   template <typename T>
   struct is_copy_assignable<T&> : true_type {};
+ template <typename A>
+ struct is_copy_assignable<A[]> : false_type {};
   template <>
   struct is_copy_assignable<void> : false_type {};
 

Modified: sandbox/conversion/boost/conversion/type_traits/is_copy_constructible.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_copy_constructible.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_copy_constructible.hpp 2011-07-17 06:54:05 EDT (Sun, 17 Jul 2011)
@@ -43,8 +43,8 @@
   struct is_copy_constructible<void> : false_type {};
   template <typename T>
   struct is_copy_constructible<T&> : true_type {};
-// template <typename T>
-// struct is_copy_constructible<T[]> : false_type {};
+ template <typename T>
+ struct is_copy_constructible<T[]> : false_type {};
 // template <typename T, std::size_t N>
 // struct is_copy_constructible<T[N]> : false_type {};
 #endif

Modified: sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp 2011-07-17 06:54:05 EDT (Sun, 17 Jul 2011)
@@ -21,6 +21,22 @@
 #include <boost/type_traits/remove_reference.hpp>
 #include <boost/type_traits/add_lvalue_reference.hpp>
 
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+ #if defined _MSC_VER
+ #elif defined __clang__
+ #define BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_USES_RVALUE
+ #elif defined __GNUC__
+ #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
+ #else
+ #define BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_USES_RVALUE
+ #endif
+ #else
+ #define BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_USES_RVALUE
+ #endif
+#else
+#endif
+
+
 namespace boost {
 
   /**
@@ -32,7 +48,7 @@
    */
   template <class T>
   struct is_move_assignable :
-#if ! defined BOOST_NO_RVALUE_REFERENCES
+#if defined BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_USES_RVALUE
     is_assignable<T&, T&&>
 #else
     is_copy_assignable<T>
@@ -48,6 +64,8 @@
    */
 // template <typename T>
 // struct is_move_assignable<T&> : true_type {};
+ template <typename A>
+ struct is_move_assignable<A[]> : false_type {};
   template <>
   struct is_move_assignable<void> : false_type {};
 

Modified: sandbox/conversion/boost/conversion/type_traits/is_move_constructible.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_move_constructible.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_move_constructible.hpp 2011-07-17 06:54:05 EDT (Sun, 17 Jul 2011)
@@ -22,6 +22,21 @@
 #include <boost/type_traits/add_rvalue_reference.hpp>
 #include <boost/type_traits/integral_constant.hpp>
 
+#if ! defined BOOST_NO_RVALUE_REFERENCES
+ #if defined _MSC_VER
+ #elif defined __clang__
+ #define BOOST_CONVERSION_TT_IS_MOVE_CONSTRUCTIBLE_USES_RVALUE
+ #elif defined __GNUC__
+ #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
+ #else
+ #define BOOST_CONVERSION_TT_IS_MOVE_CONSTRUCTIBLE_USES_RVALUE
+ #endif
+ #else
+ #define BOOST_CONVERSION_TT_IS_MOVE_CONSTRUCTIBLE_USES_RVALUE
+ #endif
+#else
+#endif
+
 namespace boost {
 
   /**
@@ -33,7 +48,7 @@
    */
   template <class T>
   struct is_move_constructible :
-#if ! defined BOOST_NO_RVALUE_REFERENCES
+#if defined BOOST_CONVERSION_TT_IS_MOVE_CONSTRUCTIBLE_USES_RVALUE
     is_constructible<T, typename add_rvalue_reference<T>::type>
 #else
     is_copy_constructible<T>
@@ -45,8 +60,8 @@
   struct is_move_constructible<void> : false_type {};
 // template <typename T>
 // struct is_move_constructible<T&> : true_type {};
-// template <typename T>
-// struct is_move_constructible<T[]> : false_type {};
+ template <typename T>
+ struct is_move_constructible<T[]> : false_type {};
 // template <typename T, std::size_t N>
 // struct is_move_constructible<T[N]> : false_type {};
 #endif


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