Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74178 - trunk/boost/type_traits
From: john_at_[hidden]
Date: 2011-08-31 13:10:35


Author: johnmaddock
Date: 2011-08-31 13:10:35 EDT (Wed, 31 Aug 2011)
New Revision: 74178
URL: http://svn.boost.org/trac/boost/changeset/74178

Log:
Apply Michel Morin's Clang patch.
Text files modified:
   trunk/boost/type_traits/intrinsics.hpp | 64 +++++++++++++++++++++++++++++++++++++++
   1 files changed, 63 insertions(+), 1 deletions(-)

Modified: trunk/boost/type_traits/intrinsics.hpp
==============================================================================
--- trunk/boost/type_traits/intrinsics.hpp (original)
+++ trunk/boost/type_traits/intrinsics.hpp 2011-08-31 13:10:35 EDT (Wed, 31 Aug 2011)
@@ -1,4 +1,3 @@
-
 // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
 // Use, modification and distribution are subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -124,6 +123,68 @@
 # define BOOST_HAS_TYPE_TRAITS_INTRINSICS
 #endif
 
+#if defined(BOOST_CLANG) && defined(__has_feature)
+# include <boost/type_traits/is_same.hpp>
+# include <boost/type_traits/is_reference.hpp>
+# include <boost/type_traits/is_volatile.hpp>
+
+# if __has_feature(is_union)
+# define BOOST_IS_UNION(T) __is_union(T)
+# endif
+// # if __has_feature(is_pod)
+// # define BOOST_IS_POD(T) __is_pod(T)
+// # endif
+// # if __has_feature(is_empty)
+// # define BOOST_IS_EMPTY(T) __is_empty(T)
+// # endif
+# if __has_feature(has_trivial_constructor)
+# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
+# endif
+# if __has_feature(has_trivial_copy)
+# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && !is_volatile<T>::value)
+# endif
+# if __has_feature(has_trivial_assign)
+# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
+# endif
+# if __has_feature(has_trivial_destructor)
+# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
+# endif
+# if __has_feature(has_nothrow_constructor)
+# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
+# endif
+# if __has_feature(has_nothrow_copy)
+# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
+# endif
+# if __has_feature(has_nothrow_assign)
+# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
+# endif
+# if __has_feature(has_virtual_destructor)
+# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
+# endif
+# if __has_feature(is_abstract)
+# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
+# endif
+# if __has_feature(is_base_of)
+# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
+# endif
+# if __has_feature(is_class)
+# define BOOST_IS_CLASS(T) __is_class(T)
+# endif
+# if __has_feature(is_convertible_to)
+# include <boost/type_traits/is_abstract.hpp>
+# define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible_to(T,U) && !::boost::is_abstract<U>::value)
+# endif
+# if __has_feature(is_enum)
+# define BOOST_IS_ENUM(T) __is_enum(T)
+# endif
+# if __has_feature(is_polymorphic)
+# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
+# endif
+# define BOOST_ALIGNMENT_OF(T) __alignof(T)
+
+# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
+#endif
+
 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__)))
 # include <boost/type_traits/is_same.hpp>
 # include <boost/type_traits/is_reference.hpp>
@@ -224,3 +285,4 @@
 
 
 
+


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