forked from boostorg/type_traits
More fixes for older GCC versions:
Don't filter through is_constructible/is_assignable etc as older GCC versions can't cope, and don't need these anyway.
This commit is contained in:
@ -28,6 +28,7 @@
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/is_assignable.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#ifdef BOOST_INTEL
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#endif
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/is_copy_constructible.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#ifdef BOOST_INTEL
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#endif
|
||||
|
@ -12,14 +12,20 @@
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_copy_constructible.hpp>
|
||||
|
||||
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG)
|
||||
#include <boost/type_traits/is_default_constructible.hpp>
|
||||
#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_copy_constructible<T>::value
|
||||
#else
|
||||
#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T> struct has_trivial_copy
|
||||
: public integral_constant<bool,
|
||||
#ifdef BOOST_HAS_TRIVIAL_COPY
|
||||
BOOST_HAS_TRIVIAL_COPY(T) && boost::is_copy_constructible<T>::value
|
||||
BOOST_HAS_TRIVIAL_COPY(T) BOOST_TT_TRIVIAL_CONSTRUCT_FIX
|
||||
#else
|
||||
::boost::is_pod<T>::value
|
||||
#endif
|
||||
@ -39,6 +45,8 @@ template <> struct has_trivial_copy<void const volatile> : public false_type{};
|
||||
|
||||
template <class T> struct has_trivial_copy_constructor : public has_trivial_copy<T>{};
|
||||
|
||||
#undef BOOST_TT_TRIVIAL_CONSTRUCT_FIX
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED
|
||||
|
@ -241,11 +241,19 @@
|
||||
# define BOOST_IS_EMPTY(T) __is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference<T>::value)
|
||||
#if (__GNUC__ * 100 + __GNUC_MINOR__) >= 409
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value && is_assignable<T&, const T&>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS && is_destructible<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value BOOST_INTEL_TT_OPTS)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value && is_assignable<T&, const T&>::value)
|
||||
#else
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_INTEL_TT_OPTS)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value && !is_array<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value && !is_array<T>::value)
|
||||
#endif
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
|
||||
|
||||
# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
|
||||
|
Reference in New Issue
Block a user