Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73095 - sandbox/conversion/boost/conversion/type_traits
From: vicente.botet_at_[hidden]
Date: 2011-07-14 05:17:14


Author: viboes
Date: 2011-07-14 05:17:13 EDT (Thu, 14 Jul 2011)
New Revision: 73095
URL: http://svn.boost.org/trac/boost/changeset/73095

Log:
conversion: fix is_constructible<T>
Text files modified:
   sandbox/conversion/boost/conversion/type_traits/is_constructible.hpp | 33 ++++++++++++++++++++++++++++++---
   1 files changed, 30 insertions(+), 3 deletions(-)

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-07-14 05:17:13 EDT (Thu, 14 Jul 2011)
@@ -35,8 +35,8 @@
 
   //! Macro stating if the compiler doesn't support the features needed to define the @c is_constructible type trait.
   #define BOOST_CONVERSION_NO_IS_CONSTRUCTIBLE
- //! Macro stating if the compiler doesn't support the features needed to define the @c is_default_constructible type trait.
- #define BOOST_CONVERSION_NO_IS_DEFAULT_CONSTRUCTIBLE
+ // Macro stating if the compiler doesn't support the features needed to define the @c is_default_constructible type trait.
+ //#define BOOST_CONVERSION_NO_IS_DEFAULT_CONSTRUCTIBLE
   //! Max number of arguments to is_constructible when using variadic templates emulation.
   #define BOOST_CONVERSION_TT_IS_CONSTRUCTIBLE_ARITY_MAX
 
@@ -102,6 +102,33 @@
     #undef M0
     #undef M1
 
+
+ #define M1(z,n,t) void
+
+ template<class T> \
+ struct is_constructible<T,void, BOOST_PP_ENUM(BOOST_CONVERSION_TT_IS_CONSTRUCTIBLE_ARITY_MAX, M1, ~)>
+ {
+ template<class X>
+ static type_traits_detail::true_type
+ test(type_traits_detail::dummy<sizeof(X(),int())>*);
+
+ template<class X>
+ static type_traits_detail::false_type
+ test(...);
+
+ static const bool value = sizeof(test<T>(0)) == sizeof(type_traits_detail::true_type);
+ typedef boost::integral_constant<bool,value> type;
+ };
+
+ template<> \
+ struct is_constructible<void,void, BOOST_PP_ENUM(BOOST_CONVERSION_TT_IS_CONSTRUCTIBLE_ARITY_MAX, M1, ~)>
+ : boost::false_type \
+ { \
+ };
+
+ #undef M1
+
+
     #define M0(z,n,t) \
     template<class A BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, class A)> \
     struct is_constructible<void, A BOOST_PP_COMMA_IF(n) BOOST_PP_ENUM_PARAMS(n, A)> \
@@ -113,7 +140,7 @@
     #undef M0
 
 
- #define BOOST_CONVERSION_NO_IS_DEFAULT_CONSTRUCTIBLE
+ //#define BOOST_CONVERSION_NO_IS_DEFAULT_CONSTRUCTIBLE
 
 #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