Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72400 - in sandbox/conversion/boost/conversion: . boost type_traits
From: vicente.botet_at_[hidden]
Date: 2011-06-04 18:57:32


Author: viboes
Date: 2011-06-04 18:57:31 EDT (Sat, 04 Jun 2011)
New Revision: 72400
URL: http://svn.boost.org/trac/boost/changeset/72400

Log:
Conversion: fix some bugs when enable is used
Text files modified:
   sandbox/conversion/boost/conversion/assign_to.hpp | 2 +-
   sandbox/conversion/boost/conversion/boost/array.hpp | 13 +++++++++----
   sandbox/conversion/boost/conversion/boost/interval.hpp | 2 ++
   sandbox/conversion/boost/conversion/boost/optional.hpp | 5 ++++-
   sandbox/conversion/boost/conversion/boost/rational.hpp | 2 ++
   sandbox/conversion/boost/conversion/convert_to.hpp | 2 +-
   sandbox/conversion/boost/conversion/type_traits/is_assignable.hpp | 5 +++++
   sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp | 6 ++++++
   8 files changed, 30 insertions(+), 7 deletions(-)

Modified: sandbox/conversion/boost/conversion/assign_to.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/assign_to.hpp (original)
+++ sandbox/conversion/boost/conversion/assign_to.hpp 2011-06-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -67,7 +67,7 @@
             , typename enable_if_c<
                     is_copy_assignable<Target>::value
                     && is_extrinsic_convertible<Source,Target>::value
- && ! is_assignable<Source,Target>::value
+ && ! is_assignable<Target,Source>::value
>::type
> : true_type
 #else

Modified: sandbox/conversion/boost/conversion/boost/array.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/array.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/array.hpp 2011-06-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -22,10 +22,13 @@
 #include <boost/conversion/assign_to.hpp>
 #include <algorithm>
 #include <boost/config.hpp>
-//#include <boost/conversion/type_traits/is_extrinsic_assignable.hpp>
-//#include <boost/conversion/type_traits/is_copy_assignable.hpp>
-//#include <boost/conversion/type_traits/is_assignable.hpp>
-//#include <boost/conversion/type_traits/is_extrinsic_convertible.hpp>
+#if defined(BOOST_CONVERSION_ENABLE_CND)
+#include <boost/conversion/type_traits/is_extrinsic_assignable.hpp>
+#include <boost/conversion/type_traits/is_copy_assignable.hpp>
+#include <boost/conversion/type_traits/is_assignable.hpp>
+#include <boost/conversion/type_traits/is_extrinsic_convertible.hpp>
+#include <boost/conversion/type_traits/is_explicitly_convertible.hpp>
+#endif
 
 namespace boost {
   namespace conversion {
@@ -38,6 +41,7 @@
 #if defined(BOOST_CONVERSION_ENABLE_CND)
     , typename enable_if_c<
             is_extrinsic_assignable<array<Source,N>,array<Target,N> >::value
+ && ! is_explicitly_convertible<array<Source,N>,array<Target,N> >::value
>::type
 #endif
> : true_type
@@ -60,6 +64,7 @@
             is_copy_assignable<Target>::value
             && is_extrinsic_assignable<Source,Target>::value
             && ! is_assignable<Source&,Target const&>::value
+ && ! assigner_specialized<array<Target,N>, array<Source,N> >::value
>::type
 #endif
> : true_type

Modified: sandbox/conversion/boost/conversion/boost/interval.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/interval.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/interval.hpp 2011-06-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -30,6 +30,7 @@
 #if defined(BOOST_CONVERSION_ENABLE_CND)
     , typename enable_if_c<
             is_extrinsic_convertible<Source,Target>::value
+ && ! is_explicitly_convertible<numeric::interval<Source,PSource>,numeric::interval<Target,PTarget> >::value
>::type
 #endif
> : true_type
@@ -45,6 +46,7 @@
 #if defined(BOOST_CONVERSION_ENABLE_CND)
     , typename enable_if_c<
             is_extrinsic_convertible<Source,Target>::value
+ && ! assigner_specialized<numeric::interval<Target,PTarget>, numeric::interval<Source,PSource> >::value
>::type
 #endif
> : true_type

Modified: sandbox/conversion/boost/conversion/boost/optional.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/optional.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/optional.hpp 2011-06-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -40,7 +40,7 @@
   }
 #endif
 
- namespace conversion {
+ namespace conversion {
     /**
      * Partial specialization of @c converter for boost::optional
      */
@@ -49,6 +49,7 @@
 #if defined(BOOST_CONVERSION_ENABLE_CND)
     , typename enable_if_c<
             is_extrinsic_convertible<Source,Target>::value
+ && ! is_explicitly_convertible<optional<Source>,optional<Target> >::value
>::type
 #endif
> : true_type
@@ -69,6 +70,8 @@
 #if defined(BOOST_CONVERSION_ENABLE_CND)
     , typename enable_if_c<
             is_extrinsic_convertible<Source,Target>::value
+ && ! detail::is_optional<Source>::value
+ && ! is_explicitly_convertible<Source,optional<Target> >::value
>::type
 #endif
> : true_type

Modified: sandbox/conversion/boost/conversion/boost/rational.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/boost/rational.hpp (original)
+++ sandbox/conversion/boost/conversion/boost/rational.hpp 2011-06-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -33,6 +33,7 @@
 #if defined(BOOST_CONVERSION_ENABLE_CND)
     , typename enable_if_c<
             is_extrinsic_convertible<Source,Target>::value
+ && ! is_explicitly_convertible<rational<Source>,rational<Target> >::value
>::type
 #endif
> : true_type
@@ -48,6 +49,7 @@
 #if defined(BOOST_CONVERSION_ENABLE_CND)
     , typename enable_if_c<
             is_extrinsic_convertible<Source,Target>::value
+ && ! assigner_specialized<rational<Target>, rational<Source> >::value
>::type
 #endif
> : true_type

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-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -34,7 +34,7 @@
 #ifndef BOOST_CONVERSION_CONVERT_TO_HPP
 #define BOOST_CONVERSION_CONVERT_TO_HPP
 
-//#define BOOST_CONVERSION_ENABLE_CND
+#define BOOST_CONVERSION_ENABLE_CND
 
 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/integral_constant.hpp>

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-06-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -23,6 +23,7 @@
 #include <boost/utility/declval.hpp>
 #include <boost/config.hpp>
 #include <utility>
+#include <boost/array.hpp>
 
 #if defined(BOOST_NO_DECLTYPE)
 #include <boost/typeof/typeof.hpp>
@@ -67,6 +68,10 @@
   struct is_assignable< std::pair<A1,A2>, std::pair<B1,B2> >
       : integral_constant<bool, is_assignable<A1,B1>::value && is_assignable<A2,B2>::value >
         {};
+ template <class T1, class T2, std::size_t N>
+ struct is_assignable< boost::array<T1,N>, boost::array<T2,N> >
+ : integral_constant<bool, is_assignable<T1,T2>::value >
+ {};
 
 #else
 

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-04 18:57:31 EDT (Sat, 04 Jun 2011)
@@ -32,6 +32,7 @@
 #include <boost/typeof/typeof.hpp>
 #endif // defined(BOOST_NO_DECLTYPE)
 #include <utility>
+#include <boost/array.hpp>
 
 namespace boost {
 
@@ -206,6 +207,11 @@
       : integral_constant<bool, is_constructible<A1,B1>::value && is_constructible<A2,B2>::value >
         {};
 
+ template <class T1, class T2, std::size_t N>
+ struct is_constructible< boost::array<T1,N>, boost::array<T2,N> , detail::is_constructible::nat>
+ : integral_constant<bool, is_constructible<T1,T2>::value >
+ {};
+
 
   namespace detail {
     namespace is_constructible {


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