Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73719 - sandbox/conversion/boost/conversion/type_traits
From: vicente.botet_at_[hidden]
Date: 2011-08-13 15:59:15


Author: viboes
Date: 2011-08-13 15:59:15 EDT (Sat, 13 Aug 2011)
New Revision: 73719
URL: http://svn.boost.org/trac/boost/changeset/73719

Log:
conversion: clang-2.9 0x supports sizeof technique
Text files modified:
   sandbox/conversion/boost/conversion/type_traits/is_assignable.hpp | 15 +++++++++++----
   sandbox/conversion/boost/conversion/type_traits/is_move_assignable.hpp | 2 +-
   2 files changed, 12 insertions(+), 5 deletions(-)

Modified: sandbox/conversion/boost/conversion/type_traits/is_assignable.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_assignable.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_assignable.hpp 2011-08-13 15:59:15 EDT (Sat, 13 Aug 2011)
@@ -57,7 +57,8 @@
      #define BOOST_CONVERSION_NO_IS_ASSIGNABLE
   #elif defined __clang__
     //#define BOOST_CONVERSION_IS_ASSIGNABLE_USES_DECLTYPE
- #define BOOST_CONVERSION_NO_IS_ASSIGNABLE
+ #define BOOST_CONVERSION_IS_ASSIGNABLE_USES_SIZEOF
+ //#define BOOST_CONVERSION_NO_IS_ASSIGNABLE
   #elif defined __GNUC__
      #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
        #define BOOST_CONVERSION_NO_IS_ASSIGNABLE
@@ -65,6 +66,8 @@
        #define BOOST_CONVERSION_IS_ASSIGNABLE_USES_DECLTYPE
      #endif
   #else
+ #error
+ #define BOOST_CONVERSION_IS_ASSIGNABLE_USES_DECLTYPE
   #endif
 #elif ! defined BOOST_NO_SFINAE_EXPR
   #if defined _MSC_VER
@@ -87,6 +90,9 @@
 #include <boost/conversion/type_traits/detail/dummy_size.hpp>
 #include <boost/type_traits/integral_constant.hpp>
 #include <boost/type_traits/common_type.hpp>
+#include <boost/type_traits/is_convertible.hpp>
+#include <boost/type_traits/is_scalar.hpp>
+#include <boost/type_traits/is_reference.hpp>
 #include <boost/utility/declval.hpp>
 #endif // !defined(BOOST_IS_ASSIGNABLE)
 
@@ -98,9 +104,10 @@
   namespace type_traits {
     namespace detail {
       namespace is_assignable {
- template <typename T,typename S,
- bool True = false,
- bool False = false >
+ template <typename T,typename S
+ , bool True =
+ ((is_scalar<T>::value || is_reference<T>::value) && is_convertible<S,T>::value)
+ , bool False = false >
         struct imp;
 
 #if defined BOOST_CONVERSION_IS_ASSIGNABLE_USES_DECLTYPE

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-08-13 15:59:15 EDT (Sat, 13 Aug 2011)
@@ -27,7 +27,7 @@
 #if ! defined BOOST_NO_RVALUE_REFERENCES
   #if defined _MSC_VER
   #elif defined __clang__
- //#define BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_USES_RVALUE
+ #define BOOST_CONVERSION_TT_IS_MOVE_ASSIGNABLE_USES_RVALUE
   #elif defined __GNUC__
      #if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
      #else


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