Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72544 - in sandbox/conversion/boost/conversion: . type_traits
From: vicente.botet_at_[hidden]
Date: 2011-06-11 12:36:57


Author: viboes
Date: 2011-06-11 12:36:56 EDT (Sat, 11 Jun 2011)
New Revision: 72544
URL: http://svn.boost.org/trac/boost/changeset/72544

Log:
Conversion: fix some bugs when enable is not used
Text files modified:
   sandbox/conversion/boost/conversion/convert_to.hpp | 1
   sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp | 44 ++++++++++++++++++++++++++++++++++++---
   sandbox/conversion/boost/conversion/type_traits/is_copy_constructible.hpp | 1
   sandbox/conversion/boost/conversion/type_traits/is_extrinsic_convertible.hpp | 8 +++++++
   4 files changed, 49 insertions(+), 5 deletions(-)

Modified: sandbox/conversion/boost/conversion/convert_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/convert_to.hpp (original)
+++ sandbox/conversion/boost/conversion/convert_to.hpp 2011-06-11 12:36:56 EDT (Sat, 11 Jun 2011)
@@ -83,7 +83,6 @@
     template < typename Target, typename Source>
     struct default_converter_condition
             : is_explicitly_convertible<Source,Target>
- >
     {};
 #endif
 

Modified: sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp 2011-06-11 12:36:56 EDT (Sat, 11 Jun 2011)
@@ -19,7 +19,7 @@
 #if 0
 
 #include <boost/config.hpp>
-#include <boost/mpl/bool.hpp>
+//#include <boost/mpl/bool.hpp>
 #include <boost/preprocessor/repetition/enum_params.hpp>
 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
 #include <boost/preprocessor/repetition/repeat.hpp>
@@ -27,9 +27,15 @@
 #include <boost/preprocessor/punctuation/comma_if.hpp>
 #include <boost/preprocessor/facilities/intercept.hpp>
 #include <cstddef>
-
+#include <boost/type_traits/integral_constant.hpp>
+#include <boost/utility/declval.hpp>
+#include <utility>
+#include <boost/array.hpp>
+#include <complex>
+#include <vector>
+#include <boost/fusion/tuple.hpp>
 #ifndef BOOST_IS_CONSTRUCTIBLE_ARITY_MAX
-#define BOOST_IS_CONSTRUCTIBLE_ARITY_MAX 5
+#define BOOST_IS_CONSTRUCTIBLE_ARITY_MAX 3
 #endif
 
 namespace boost
@@ -66,7 +72,7 @@
         test(...); \
                                                                                                         \
         static const bool value = sizeof(test<T>(0)) == sizeof(type_traits_detail::true_type); \
- typedef boost::mpl::bool_<value> type; \
+ typedef boost::integral_constant<bool,value> type; \
     };
 
     BOOST_PP_REPEAT(BOOST_IS_CONSTRUCTIBLE_ARITY_MAX, M0, ~)
@@ -87,6 +93,36 @@
 
 #endif
 
+ template <class A1, class A2, class B1, class B2>
+ struct is_constructible< std::pair<A1,A2>, std::pair<B1,B2> >
+ : integral_constant<bool, is_constructible<A1,B1>::value && is_constructible<A2,B2>::value >
+ {};
+
+#if 0
+ template <class T1, class T2, std::size_t N>
+ struct is_constructible< boost::array<T1,N>, boost::array<T2,N> >
+ : integral_constant<bool, is_constructible<T1,T2>::value >
+ {};
+#endif
+ template < class Target, class Source>
+ struct is_constructible< std::complex<Target>, std::complex<Source> >
+ : integral_constant<bool, is_constructible<Target,Source>::value >
+ {};
+
+ template < class T1, class A1, class T2, class A2>
+ struct is_constructible< std::vector<T1,A1>, std::vector<T2,A2> >
+ : integral_constant<bool, is_constructible<T1,T2>::value >
+ {};
+
+ template <class A1, class A2, class B1, class B2>
+ struct is_constructible< fusion::tuple<A1,A2>, fusion::tuple<B1,B2> >
+ : integral_constant<bool, is_constructible<A1,B1>::value && is_constructible<A2,B2>::value >
+ {};
+
+ template <class A1, class A2, class A3, class B1, class B2, class B3>
+ struct is_constructible< fusion::tuple<A1,A2,A3>, fusion::tuple<B1,B2,B3> >
+ : integral_constant<bool, is_constructible<A1,B1>::value && is_constructible<A2,B2>::value&& is_constructible<A3,B3>::value >
+ {};
 }
 
 #else

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-06-11 12:36:56 EDT (Sat, 11 Jun 2011)
@@ -18,6 +18,7 @@
 
 #include <boost/conversion/type_traits/is_constructible.hpp>
 #include <boost/type_traits/remove_reference.hpp>
+#include <boost/type_traits/integral_constant.hpp>
 
 namespace boost {
 

Modified: sandbox/conversion/boost/conversion/type_traits/is_extrinsic_convertible.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_extrinsic_convertible.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_extrinsic_convertible.hpp 2011-06-11 12:36:56 EDT (Sat, 11 Jun 2011)
@@ -25,6 +25,14 @@
   struct is_extrinsic_convertible : conversion::converter<Target, Source> {};
   template <class T>
   struct is_extrinsic_convertible<fusion::void_,T> : false_type {};
+ template <>
+ struct is_extrinsic_convertible<void, void> : true_type {};
+ template <>
+ struct is_extrinsic_convertible<const void,void> : true_type {};
+ template <>
+ struct is_extrinsic_convertible<void, const void> : true_type {};
+ template <>
+ struct is_extrinsic_convertible<const void, const void> : true_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