Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73280 - sandbox/conversion/boost/conversion/type_traits
From: vicente.botet_at_[hidden]
Date: 2011-07-21 13:45:11


Author: viboes
Date: 2011-07-21 13:45:11 EDT (Thu, 21 Jul 2011)
New Revision: 73280
URL: http://svn.boost.org/trac/boost/changeset/73280

Log:
conversion:: refactor is_destructible
Text files modified:
   sandbox/conversion/boost/conversion/type_traits/is_destructible.hpp | 36 +++++++++++++++++++++---------------
   1 files changed, 21 insertions(+), 15 deletions(-)

Modified: sandbox/conversion/boost/conversion/type_traits/is_destructible.hpp
==============================================================================
--- sandbox/conversion/boost/conversion/type_traits/is_destructible.hpp (original)
+++ sandbox/conversion/boost/conversion/type_traits/is_destructible.hpp 2011-07-21 13:45:11 EDT (Thu, 21 Jul 2011)
@@ -12,12 +12,9 @@
  * @brief Defines the type trait @c is_destructible.
  */
 
-
 #ifndef BOOST_CONVERSION_TT_IS_DESTRUCTIBLE_HPP
 #define BOOST_CONVERSION_TT_IS_DESTRUCTIBLE_HPP
 
-
-
 #if defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
 namespace boost {
   /**
@@ -126,6 +123,8 @@
     {
         U u;
     };
+ template <class T, bool False = is_void<T>::value || is_abstract<T>::value, bool True = is_scalar<T>::value >
+ struct imp;
 #if defined BOOST_CONVERSION_IS_DESTRUCTIBLE_USES_DECLTYPE
 
     template <class T>
@@ -139,14 +138,14 @@
     false_type
     selector(any);
 
- template <class T, bool = is_void<T>::value || is_abstract<T>::value, bool = is_scalar<T>::value >
- struct imp
+ template <class T>
+ struct imp<T,false,false>
     : public common_type<decltype(selector(declval<T>()))>::type {};
 
 #elif defined BOOST_CONVERSION_IS_DESTRUCTIBLE_USES_SIZEOF
 
- template <class T, bool = is_void<T>::value || is_abstract<T>::value, bool = is_scalar<T>::value >
- struct imp
+ template <class T>
+ struct imp<T,false,false>
     {
       template<class X>
       static type_traits_detail_is_destructible::yes_type
@@ -162,8 +161,8 @@
     };
 
 #else
- template <class T, bool = is_void<T>::value || is_abstract<T>::value, bool = is_scalar<T>::value >
- struct imp
+ template <class T>
+ struct imp<T,false,false>
     : public false_type {};
 #endif
     template <class T, bool IsScalar>
@@ -178,24 +177,31 @@
   struct is_destructible
       : public type_traits_detail_is_destructible::imp<T> {};
 
-#if !defined(BOOST_CONVERSION_DOXYGEN_INVOKED)
-
   /**
    * @c is_destructible specialization for reference types.
    *
- * Condition: references are always copy assignable.
+ * Condition: references are always destructible.
    */
   template <typename T>
   struct is_destructible<T&> : true_type {};
+ /**
+ * @c is_destructible specialization for unbound arrays.
+ *
+ * Condition: unbound arrays are no destructible.
+ */
   template <typename A>
   struct is_destructible<A[]> : false_type {};
+ /**
+ * @c is_destructible specialization for bound arrays.
+ *
+ * Condition: is_destructible<A>.
+ */
   template <typename A, std::size_t N>
   struct is_destructible<A[N]> : is_destructible<A> {};
 
-#endif
 }
 
 
-#endif
-#endif
+#endif // doc
+#endif // header
 


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