forked from boostorg/type_traits
Merge branch 'Version2' into develop
This commit is contained in:
commit
22fd60efe3
173 files changed
+2037
-794
No files matched your search
@@ -27,37 +27,81 @@
|
||||
#include "boost/type_traits/extent.hpp"
|
||||
#include "boost/type_traits/floating_point_promotion.hpp"
|
||||
#include "boost/type_traits/function_traits.hpp"
|
||||
|
||||
#include "boost/type_traits/has_bit_and.hpp"
|
||||
#include "boost/type_traits/has_bit_and_assign.hpp"
|
||||
#include "boost/type_traits/has_bit_or.hpp"
|
||||
#include "boost/type_traits/has_bit_or_assign.hpp"
|
||||
#include "boost/type_traits/has_bit_xor.hpp"
|
||||
#include "boost/type_traits/has_bit_xor_assign.hpp"
|
||||
#include "boost/type_traits/has_complement.hpp"
|
||||
#include "boost/type_traits/has_dereference.hpp"
|
||||
#include "boost/type_traits/has_divides.hpp"
|
||||
#include "boost/type_traits/has_divides_assign.hpp"
|
||||
#include "boost/type_traits/has_equal_to.hpp"
|
||||
#include "boost/type_traits/has_greater.hpp"
|
||||
#include "boost/type_traits/has_greater_equal.hpp"
|
||||
#include "boost/type_traits/has_left_shift.hpp"
|
||||
#include "boost/type_traits/has_left_shift_assign.hpp"
|
||||
#include "boost/type_traits/has_less.hpp"
|
||||
#include "boost/type_traits/has_less_equal.hpp"
|
||||
#include "boost/type_traits/has_logical_and.hpp"
|
||||
#include "boost/type_traits/has_logical_not.hpp"
|
||||
#include "boost/type_traits/has_logical_or.hpp"
|
||||
#include "boost/type_traits/has_minus.hpp"
|
||||
#include "boost/type_traits/has_minus_assign.hpp"
|
||||
#include "boost/type_traits/has_modulus.hpp"
|
||||
#include "boost/type_traits/has_modulus_assign.hpp"
|
||||
#include "boost/type_traits/has_multiplies.hpp"
|
||||
#include "boost/type_traits/has_multiplies_assign.hpp"
|
||||
#include "boost/type_traits/has_negate.hpp"
|
||||
#if !defined(__BORLANDC__) && !defined(__CUDACC__)
|
||||
#include "boost/type_traits/has_new_operator.hpp"
|
||||
#endif
|
||||
#include "boost/type_traits/has_not_equal_to.hpp"
|
||||
#include "boost/type_traits/has_nothrow_assign.hpp"
|
||||
#include "boost/type_traits/has_nothrow_constructor.hpp"
|
||||
#include "boost/type_traits/has_nothrow_copy.hpp"
|
||||
#include "boost/type_traits/has_nothrow_destructor.hpp"
|
||||
#include <boost/type_traits/has_operator.hpp>
|
||||
#include "boost/type_traits/has_plus.hpp"
|
||||
#include "boost/type_traits/has_plus_assign.hpp"
|
||||
#include "boost/type_traits/has_post_decrement.hpp"
|
||||
#include "boost/type_traits/has_post_increment.hpp"
|
||||
#include "boost/type_traits/has_pre_decrement.hpp"
|
||||
#include "boost/type_traits/has_pre_increment.hpp"
|
||||
#include "boost/type_traits/has_right_shift.hpp"
|
||||
#include "boost/type_traits/has_right_shift_assign.hpp"
|
||||
#include "boost/type_traits/has_trivial_assign.hpp"
|
||||
#include "boost/type_traits/has_trivial_constructor.hpp"
|
||||
#include "boost/type_traits/has_trivial_copy.hpp"
|
||||
#include "boost/type_traits/has_trivial_destructor.hpp"
|
||||
#include "boost/type_traits/has_trivial_move_assign.hpp"
|
||||
#include "boost/type_traits/has_trivial_move_constructor.hpp"
|
||||
#include "boost/type_traits/has_unary_minus.hpp"
|
||||
#include "boost/type_traits/has_unary_plus.hpp"
|
||||
#include "boost/type_traits/has_virtual_destructor.hpp"
|
||||
|
||||
#include "boost/type_traits/integral_constant.hpp"
|
||||
|
||||
#include "boost/type_traits/is_abstract.hpp"
|
||||
#include "boost/type_traits/is_assignable.hpp"
|
||||
#include "boost/type_traits/is_arithmetic.hpp"
|
||||
#include "boost/type_traits/is_array.hpp"
|
||||
#include "boost/type_traits/is_assignable.hpp"
|
||||
#include "boost/type_traits/is_base_and_derived.hpp"
|
||||
#include "boost/type_traits/is_base_of.hpp"
|
||||
#include "boost/type_traits/is_class.hpp"
|
||||
#include <boost/type_traits/is_complex.hpp>
|
||||
#include "boost/type_traits/is_complex.hpp"
|
||||
#include "boost/type_traits/is_compound.hpp"
|
||||
#include "boost/type_traits/is_const.hpp"
|
||||
#include "boost/type_traits/is_constructible.hpp"
|
||||
#include "boost/type_traits/is_convertible.hpp"
|
||||
#include "boost/type_traits/is_copy_constructible.hpp"
|
||||
#include "boost/type_traits/is_copy_assignable.hpp"
|
||||
#include "boost/type_traits/is_copy_constructible.hpp"
|
||||
#include "boost/type_traits/is_default_constructible.hpp"
|
||||
#include "boost/type_traits/is_destructible.hpp"
|
||||
#include "boost/type_traits/is_empty.hpp"
|
||||
#include "boost/type_traits/is_enum.hpp"
|
||||
#include "boost/type_traits/is_final.hpp"
|
||||
#include "boost/type_traits/is_float.hpp"
|
||||
#include "boost/type_traits/is_floating_point.hpp"
|
||||
#include "boost/type_traits/is_function.hpp"
|
||||
@@ -71,32 +115,33 @@
|
||||
#include "boost/type_traits/is_nothrow_move_constructible.hpp"
|
||||
#include "boost/type_traits/is_object.hpp"
|
||||
#include "boost/type_traits/is_pod.hpp"
|
||||
#include "boost/type_traits/is_polymorphic.hpp"
|
||||
#include "boost/type_traits/is_pointer.hpp"
|
||||
#include "boost/type_traits/is_polymorphic.hpp"
|
||||
#include "boost/type_traits/is_reference.hpp"
|
||||
#include "boost/type_traits/is_rvalue_reference.hpp"
|
||||
#include "boost/type_traits/is_signed.hpp"
|
||||
#include "boost/type_traits/is_same.hpp"
|
||||
#include "boost/type_traits/is_scalar.hpp"
|
||||
#include "boost/type_traits/is_signed.hpp"
|
||||
#include "boost/type_traits/is_stateless.hpp"
|
||||
#include "boost/type_traits/is_union.hpp"
|
||||
#include "boost/type_traits/is_unsigned.hpp"
|
||||
#include "boost/type_traits/is_void.hpp"
|
||||
#include "boost/type_traits/is_virtual_base_of.hpp"
|
||||
#include "boost/type_traits/is_void.hpp"
|
||||
#include "boost/type_traits/is_volatile.hpp"
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <boost/type_traits/make_signed.hpp>
|
||||
#include "boost/type_traits/make_signed.hpp"
|
||||
#include "boost/type_traits/make_unsigned.hpp"
|
||||
#include "boost/type_traits/rank.hpp"
|
||||
#include "boost/type_traits/remove_bounds.hpp"
|
||||
#include "boost/type_traits/remove_extent.hpp"
|
||||
#include "boost/type_traits/remove_all_extents.hpp"
|
||||
#include "boost/type_traits/remove_bounds.hpp"
|
||||
#include "boost/type_traits/remove_const.hpp"
|
||||
#include "boost/type_traits/remove_cv.hpp"
|
||||
#include "boost/type_traits/remove_extent.hpp"
|
||||
#include "boost/type_traits/remove_pointer.hpp"
|
||||
#include "boost/type_traits/remove_reference.hpp"
|
||||
#include "boost/type_traits/remove_volatile.hpp"
|
||||
#include "boost/type_traits/type_identity.hpp"
|
||||
#include "boost/type_traits/type_with_alignment.hpp"
|
||||
|
||||
#if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238))
|
||||
#include "boost/type_traits/integral_promotion.hpp"
|
||||
#include "boost/type_traits/promote.hpp"
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
|
||||
// (C) Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_DETAIL_DECL_HEADER
|
||||
#define BOOST_TT_DETAIL_DECL_HEADER
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/type_traits/add_rvalue_reference.hpp>
|
||||
#include <boost/type_traits/add_lvalue_reference.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
namespace boost { namespace detail{
|
||||
|
||||
template <typename T>
|
||||
typename add_rvalue_reference<T>::type tt_declval() BOOST_NOEXCEPT; // as unevaluated operand
|
||||
template <typename T>
|
||||
typename add_lvalue_reference<typename remove_reference<T>::type const>::type tt_decl_const_ref() BOOST_NOEXCEPT; // as unevaluated operand
|
||||
template <typename T>
|
||||
typename add_lvalue_reference<typename remove_reference<T>::type>::type tt_decl_ref() BOOST_NOEXCEPT; // as unevaluated operand
|
||||
|
||||
|
||||
}} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_DETAIL_DECL_HEADER
|
||||
@@ -15,18 +15,20 @@
|
||||
#if !defined(BOOST_HAS_NOTHROW_ASSIGN) || defined(BOOST_MSVC) || defined(BOOST_INTEL)
|
||||
#include <boost/type_traits/has_trivial_assign.hpp>
|
||||
#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#include <boost/type_traits/detail/decl.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/type_traits/is_assignable.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#endif
|
||||
#endif
|
||||
#if defined(__GNUC__) || defined(__SUNPRO_CC)
|
||||
#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
|
||||
@@ -39,7 +41,7 @@ namespace boost {
|
||||
namespace detail
|
||||
{
|
||||
template <class T, bool b1, bool b2> struct has_nothrow_assign_imp{ static const bool value = false; };
|
||||
template <class T> struct has_nothrow_assign_imp<T, false, true>{ static const bool value = noexcept(detail::tt_decl_ref<T>() = detail::tt_decl_const_ref<T>()); };
|
||||
template <class T> struct has_nothrow_assign_imp<T, false, true>{ static const bool value = noexcept(boost::declval<typename add_reference<T>::type>() = boost::declval<typename add_reference<T const>::type>()); };
|
||||
template <class T, std::size_t N> struct has_nothrow_assign_imp<T[N], false, true>{ static const bool value = has_nothrow_assign_imp<T, false, true>::value; };
|
||||
template <class T> struct has_nothrow_assign_imp<T[], false, true>{ static const bool value = has_nothrow_assign_imp<T, false, true>::value; };
|
||||
}
|
||||
|
||||
@@ -14,20 +14,44 @@
|
||||
|
||||
#ifdef BOOST_HAS_NOTHROW_COPY
|
||||
|
||||
#if defined(BOOST_CLANG) || defined(__GNUC__) || defined(__ghs__) || defined(__CODEGEARC__)
|
||||
#if defined(BOOST_CLANG) || defined(__GNUC__) || defined(__ghs__) || defined(__CODEGEARC__) || defined(__SUNPRO_CC)
|
||||
#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
|
||||
#elif defined(BOOST_MSVC) || defined(BOOST_INTEL)
|
||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct has_nothrow_copy_constructor : public integral_constant<bool, BOOST_HAS_NOTHROW_COPY(T)>{};
|
||||
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT)
|
||||
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/is_copy_constructible.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <class T, bool b>
|
||||
struct has_nothrow_copy_constructor_imp : public boost::integral_constant<bool, false>{};
|
||||
template <class T>
|
||||
struct has_nothrow_copy_constructor_imp<T, true> : public boost::integral_constant<bool, noexcept(T(boost::declval<const T&>()))>{};
|
||||
|
||||
}
|
||||
|
||||
template <class T> struct has_nothrow_copy_constructor : public detail::has_nothrow_copy_constructor_imp<T, boost::is_copy_constructible<T>::value>{};
|
||||
template <class T> struct has_nothrow_copy_constructor<T&> : public integral_constant<bool, false>{};
|
||||
template <class T> struct has_nothrow_copy_constructor<T&&> : public integral_constant<bool, false>{};
|
||||
template <class T> struct has_nothrow_copy_constructor<T volatile> : public integral_constant<bool, false>{};
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/has_trivial_copy.hpp>
|
||||
|
||||
@@ -11,10 +11,36 @@
|
||||
|
||||
#include <boost/type_traits/has_trivial_destructor.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(__SUNPRO_CC)
|
||||
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/is_destructible.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace detail{
|
||||
|
||||
template <class T, bool b>
|
||||
struct has_nothrow_destructor_imp : public boost::integral_constant<bool, false>{};
|
||||
template <class T>
|
||||
struct has_nothrow_destructor_imp<T, true> : public boost::integral_constant<bool, noexcept(boost::declval<T*&>()->~T())>{};
|
||||
|
||||
}
|
||||
|
||||
template <class T> struct has_nothrow_destructor : public detail::has_nothrow_destructor_imp<T, boost::is_destructible<T>::value>{};
|
||||
template <class T, std::size_t N> struct has_nothrow_destructor<T[N]> : public has_nothrow_destructor<T>{};
|
||||
template <class T> struct has_nothrow_destructor<T&> : public integral_constant<bool, false>{};
|
||||
template <class T> struct has_nothrow_destructor<T&&> : public integral_constant<bool, false>{};
|
||||
|
||||
}
|
||||
#else
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct has_nothrow_destructor : public ::boost::has_trivial_destructor<T> {};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TT_HAS_NOTHROW_DESTRUCTOR_HPP_INCLUDED
|
||||
@@ -13,29 +13,33 @@
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
#if !defined(BOOST_HAS_TRIVIAL_ASSIGN) || defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL) || defined(__SUNPRO_CC)
|
||||
#if !defined(BOOST_HAS_TRIVIAL_ASSIGN) || defined(BOOST_MSVC) || defined(__GNUC__) || defined(BOOST_INTEL) || defined(__SUNPRO_CC) || defined(__clang)
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/type_traits/is_const.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/is_assignable.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T>
|
||||
struct has_trivial_assign : public integral_constant<bool,
|
||||
template <typename T>
|
||||
struct has_trivial_assign : public integral_constant < bool,
|
||||
#ifdef BOOST_HAS_TRIVIAL_ASSIGN
|
||||
BOOST_HAS_TRIVIAL_ASSIGN(T)
|
||||
BOOST_HAS_TRIVIAL_ASSIGN(T)
|
||||
#else
|
||||
::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value
|
||||
::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value
|
||||
#endif
|
||||
> {};
|
||||
|
||||
template<> struct has_trivial_assign<void> : public false_type{};
|
||||
template<> struct has_trivial_assign<void> : public false_type{};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template<> struct has_trivial_assign<void const> : public false_type{};
|
||||
template<> struct has_trivial_assign<void const volatile> : public false_type{};
|
||||
template<> struct has_trivial_assign<void volatile> : public false_type{};
|
||||
template<> struct has_trivial_assign<void const> : public false_type{};
|
||||
template<> struct has_trivial_assign<void const volatile> : public false_type{};
|
||||
template<> struct has_trivial_assign<void volatile> : public false_type{};
|
||||
#endif
|
||||
// Arrays are not explictly assignable:
|
||||
template <typename T, std::size_t N> struct has_trivial_assign<T[N]> : public false_type{};
|
||||
template <typename T> struct has_trivial_assign<T[]> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -11,11 +11,12 @@
|
||||
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/type_traits/is_default_constructible.hpp>
|
||||
|
||||
#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR
|
||||
#ifdef BOOST_HAS_SGI_TYPE_TRAITS
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#elif defined(__GNUC__)
|
||||
#elif defined(__GNUC__) || defined(__SUNPRO_CC)
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#ifdef BOOST_INTEL
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
@@ -23,17 +24,34 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG) || (defined(__SUNPRO_CC) && defined(BOOST_HAS_TRIVIAL_CONSTRUCTOR))
|
||||
#include <boost/type_traits/is_default_constructible.hpp>
|
||||
#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_default_constructible<T>::value
|
||||
#else
|
||||
//
|
||||
// Mot all compilers, particularly older GCC versions can handle the fix above.
|
||||
#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T> struct has_trivial_constructor
|
||||
#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR
|
||||
: public integral_constant <bool, (::boost::is_pod<T>::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T))>{};
|
||||
: public integral_constant <bool, ((::boost::is_pod<T>::value || BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)) BOOST_TT_TRIVIAL_CONSTRUCT_FIX)>{};
|
||||
#else
|
||||
: public integral_constant <bool, ::boost::is_pod<T>::value>{};
|
||||
#endif
|
||||
|
||||
template <> struct has_trivial_constructor<void> : public boost::false_type{};
|
||||
template <> struct has_trivial_constructor<void const> : public boost::false_type{};
|
||||
template <> struct has_trivial_constructor<void const volatile> : public boost::false_type{};
|
||||
template <> struct has_trivial_constructor<void volatile> : public boost::false_type{};
|
||||
|
||||
template <class T> struct has_trivial_default_constructor : public has_trivial_constructor<T> {};
|
||||
|
||||
#undef BOOST_TT_TRIVIAL_CONSTRUCT_FIX
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_HAS_TRIVIAL_CONSTRUCTOR_HPP_INCLUDED
|
||||
@@ -10,12 +10,14 @@
|
||||
#define BOOST_TT_HAS_TRIVIAL_COPY_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
|
||||
#ifdef __clang__
|
||||
#if (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ >= 409)) || defined(BOOST_CLANG) || (defined(__SUNPRO_CC) && defined(BOOST_HAS_TRIVIAL_COPY))
|
||||
#include <boost/type_traits/is_copy_constructible.hpp>
|
||||
#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX && is_copy_constructible<T>::value
|
||||
#else
|
||||
#define BOOST_TT_TRIVIAL_CONSTRUCT_FIX
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
@@ -23,22 +25,16 @@ namespace boost {
|
||||
template <typename T> struct has_trivial_copy
|
||||
: public integral_constant<bool,
|
||||
#ifdef BOOST_HAS_TRIVIAL_COPY
|
||||
# ifdef __clang__
|
||||
BOOST_HAS_TRIVIAL_COPY(T) && boost::is_copy_constructible<T>::value
|
||||
# else
|
||||
BOOST_HAS_TRIVIAL_COPY(T)
|
||||
# endif
|
||||
BOOST_HAS_TRIVIAL_COPY(T) BOOST_TT_TRIVIAL_CONSTRUCT_FIX
|
||||
#else
|
||||
::boost::is_pod<T>::value && ! ::boost::is_volatile<T>::value
|
||||
::boost::is_pod<T>::value
|
||||
#endif
|
||||
>{};
|
||||
|
||||
#ifdef __clang__
|
||||
|
||||
template <typename T, std::size_t N>
|
||||
struct has_trivial_copy<T[N]> : public has_trivial_copy<T>{};
|
||||
|
||||
#endif
|
||||
// Arrays are not explicitly copyable:
|
||||
template <typename T, std::size_t N> struct has_trivial_copy<T[N]> : public false_type{};
|
||||
template <typename T> struct has_trivial_copy<T[]> : public false_type{};
|
||||
// Are volatile types ever trivial? We don't really know, so assume not:
|
||||
template <typename T> struct has_trivial_copy<T volatile> : public false_type{};
|
||||
|
||||
template <> struct has_trivial_copy<void> : public false_type{};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
@@ -49,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
|
||||
@@ -21,6 +21,10 @@
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang) || defined(__SUNPRO_CC)
|
||||
#include <boost/type_traits/is_destructible.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T> struct has_trivial_destructor : public integral_constant<bool, BOOST_HAS_TRIVIAL_DESTRUCTOR(T)>{};
|
||||
|
||||
@@ -23,14 +23,31 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace boost {
|
||||
#if defined(__GNUC__) || defined(__clang)
|
||||
#include <boost/type_traits/is_assignable.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef __SUNPRO_CC
|
||||
#include <boost/type_traits/is_assignable.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#if __cplusplus >= 201103
|
||||
#define SOLARIS_EXTRA_CHECK && is_assignable<typename remove_const<T>::type&, typename remove_const<T>::type&&>::value
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SOLARIS_EXTRA_CHECK
|
||||
#define SOLARIS_EXTRA_CHECK
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
template <typename T>
|
||||
struct has_trivial_move_assign : public integral_constant<bool,
|
||||
#ifdef BOOST_HAS_TRIVIAL_MOVE_ASSIGN
|
||||
BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T)
|
||||
#else
|
||||
::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value
|
||||
::boost::is_pod<T>::value && !::boost::is_const<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK
|
||||
#endif
|
||||
> {};
|
||||
|
||||
@@ -40,7 +57,16 @@ template <> struct has_trivial_move_assign<void const> : public false_type{};
|
||||
template <> struct has_trivial_move_assign<void const volatile> : public false_type{};
|
||||
template <> struct has_trivial_move_assign<void volatile> : public false_type{};
|
||||
#endif
|
||||
template <class T> struct has_trivial_move_assign<T&> : public false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct has_trivial_move_assign<T&&> : public false_type{};
|
||||
#endif
|
||||
// Array types are not assignable:
|
||||
template <class T, std::size_t N> struct has_trivial_move_assign<T[N]> : public false_type{};
|
||||
template <class T> struct has_trivial_move_assign<T[]> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#undef SOLARIS_EXTRA_CHECK
|
||||
|
||||
#endif // BOOST_TT_HAS_TRIVIAL_MOVE_ASSIGN_HPP_INCLUDED
|
||||
@@ -21,19 +21,40 @@
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) || defined(__clang)
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
#endif
|
||||
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T> struct has_trivial_move_constructor : public integral_constant<bool, BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T)>{};
|
||||
|
||||
#else
|
||||
|
||||
#ifdef __SUNPRO_CC
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
#include <boost/type_traits/remove_const.hpp>
|
||||
#if __cplusplus >= 201103
|
||||
#define SOLARIS_EXTRA_CHECK && is_constructible<typename remove_const<T>::type, typename remove_const<T>::type&&>::value
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SOLARIS_EXTRA_CHECK
|
||||
#define SOLARIS_EXTRA_CHECK
|
||||
#endif
|
||||
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/type_traits/is_volatile.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T> struct has_trivial_move_constructor
|
||||
: public integral_constant<bool, ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value>{};
|
||||
: public integral_constant<bool, ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value SOLARIS_EXTRA_CHECK>{};
|
||||
|
||||
#undef SOLARIS_EXTRA_CHECK
|
||||
|
||||
#endif
|
||||
|
||||
template <> struct has_trivial_move_constructor<void> : public false_type{};
|
||||
@@ -42,6 +63,14 @@ template <> struct has_trivial_move_constructor<void const> : public false_type{
|
||||
template <> struct has_trivial_move_constructor<void volatile> : public false_type{};
|
||||
template <> struct has_trivial_move_constructor<void const volatile> : public false_type{};
|
||||
#endif
|
||||
// What should we do with reference types??? The standard seems to suggest these are trivial, even if the thing they reference is not:
|
||||
template <class T> struct has_trivial_move_constructor<T&> : public true_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct has_trivial_move_constructor<T&&> : public true_type{};
|
||||
#endif
|
||||
// Arrays can not be explicitly copied:
|
||||
template <class T, std::size_t N> struct has_trivial_move_constructor<T[N]> : public false_type{};
|
||||
template <class T> struct has_trivial_move_constructor<T[]> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -99,11 +99,11 @@
|
||||
# define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(T))
|
||||
# define BOOST_IS_EMPTY(T) __is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T)|| ( ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value))
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) || ::boost::is_pod<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod<T>::value && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value))
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) || ::boost::has_trivial_copy<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) || ::boost::has_trivial_copy<T>::value) && !is_array<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign<T>::value)
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
|
||||
|
||||
@@ -171,22 +171,22 @@
|
||||
# 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)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_assign)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_destructor)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) && is_destructible<T>::value)
|
||||
# endif
|
||||
# if __has_feature(has_nothrow_constructor)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) && is_default_constructible<T>::value)
|
||||
# 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)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value && is_constructible<T, const T&>::value)
|
||||
# endif
|
||||
# if __has_feature(has_nothrow_assign)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value && is_assignable<T&, const T&>::value)
|
||||
# endif
|
||||
# if __has_feature(has_virtual_destructor)
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
|
||||
@@ -210,10 +210,10 @@
|
||||
# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_move_constructor)
|
||||
# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) __has_trivial_move_constructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__has_trivial_move_constructor(T) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
|
||||
# endif
|
||||
# if __has_feature(has_trivial_move_assign)
|
||||
# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) __has_trivial_move_assign(T)
|
||||
# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__has_trivial_move_assign(T) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
|
||||
# endif
|
||||
# define BOOST_ALIGNMENT_OF(T) __alignof(T)
|
||||
# if __has_feature(is_final)
|
||||
@@ -240,12 +240,20 @@
|
||||
# define BOOST_IS_POD(T) __is_pod(T)
|
||||
# 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 && ! ::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) && 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)
|
||||
# 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)
|
||||
# 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)
|
||||
@@ -263,24 +271,26 @@
|
||||
# define BOOST_IS_FINAL(T) __is_final(T)
|
||||
# endif
|
||||
|
||||
# if (__GNUC__ >= 5) && (__cplusplus >= 201103)
|
||||
# define BOOST_HAS_TRIVIAL_MOVE_ASSIGN(T) (__is_trivially_assignable(T&, T&&) && is_assignable<T&, T&&>::value && !::boost::is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_MOVE_CONSTRUCTOR(T) (__is_trivially_constructible(T, T&&) && is_constructible<T, T&&>::value && !::boost::is_volatile<T>::value)
|
||||
# endif
|
||||
|
||||
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
|
||||
#endif
|
||||
|
||||
#if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130)
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
# include <boost/type_traits/is_reference.hpp>
|
||||
# include <boost/type_traits/is_volatile.hpp>
|
||||
|
||||
# define BOOST_IS_UNION(T) __oracle_is_union(T)
|
||||
# define BOOST_IS_POD(T) __oracle_is_pod(T)
|
||||
# define BOOST_IS_POD(T) (__oracle_is_pod(T) && !is_function<T>::value)
|
||||
# define BOOST_IS_EMPTY(T) __oracle_is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__oracle_has_trivial_constructor(T) && ! ::boost::is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference<T>::value && ! ::boost::is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __oracle_has_trivial_destructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__oracle_has_trivial_copy(T) && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value && is_assignable<T&, const T&>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__oracle_has_trivial_destructor(T) && is_destructible<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) ((__oracle_has_nothrow_constructor(T) || __oracle_has_trivial_constructor(T) || __oracle_is_trivial(T)) && is_default_constructible<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) ((__oracle_has_nothrow_copy(T) || __oracle_has_trivial_copy(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_reference<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__oracle_has_nothrow_assign(T) || __oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_const<T>::value)
|
||||
// __oracle_has_nothrow_copy appears to behave the same as __oracle_has_nothrow_assign, disabled for now:
|
||||
//# define BOOST_HAS_NOTHROW_COPY(T) ((__oracle_has_nothrow_copy(T) || __oracle_has_trivial_copy(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_reference<T>::value && is_copy_constructible<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) ((__oracle_has_nothrow_assign(T) || __oracle_has_trivial_assign(T) || __oracle_is_trivial(T)) && !is_volatile<T>::value && !is_const<T>::value && is_assignable<T&, const T&>::value)
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __oracle_has_virtual_destructor(T)
|
||||
|
||||
# define BOOST_IS_ABSTRACT(T) __oracle_is_abstract(T)
|
||||
@@ -303,7 +313,7 @@
|
||||
# define BOOST_IS_POD(T) __is_pod(T)
|
||||
# define BOOST_IS_EMPTY(T) __is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
@@ -330,7 +340,7 @@
|
||||
# define BOOST_IS_POD(T) __is_pod(T)
|
||||
# define BOOST_IS_EMPTY(T) __is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace boost{
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/type_traits/detail/decl.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace boost{
|
||||
|
||||
struct is_assignable_imp
|
||||
{
|
||||
template<typename T, typename U, typename = decltype(tt_declval<T>() = tt_declval<U>())>
|
||||
template<typename T, typename U, typename = decltype(boost::declval<T>() = boost::declval<U>())>
|
||||
static boost::type_traits::yes_type test(int);
|
||||
|
||||
template<typename, typename>
|
||||
|
||||
@@ -14,8 +14,10 @@
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
|
||||
#include <boost/type_traits/is_destructible.hpp>
|
||||
#include <boost/type_traits/is_default_constructible.hpp>
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/type_traits/detail/decl.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
@@ -23,16 +25,35 @@ namespace boost{
|
||||
|
||||
struct is_constructible_imp
|
||||
{
|
||||
template<typename T, typename ...TheArgs, typename = decltype(T(tt_declval<TheArgs>()...))>
|
||||
template<typename T, typename ...TheArgs, typename = decltype(T(boost::declval<TheArgs>()...))>
|
||||
static boost::type_traits::yes_type test(int);
|
||||
|
||||
template<typename, typename>
|
||||
template<typename, typename...>
|
||||
static boost::type_traits::no_type test(...);
|
||||
|
||||
template<typename T, typename Arg, typename = decltype(::new T(boost::declval<Arg>()))>
|
||||
static boost::type_traits::yes_type test1(int);
|
||||
template<typename, typename>
|
||||
static boost::type_traits::no_type test1(...);
|
||||
|
||||
template <typename T>
|
||||
static boost::type_traits::yes_type ref_test(T);
|
||||
template <typename T>
|
||||
static boost::type_traits::no_type ref_test(...);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <class T, class ...Args> struct is_constructible : public integral_constant<bool, sizeof(detail::is_constructible_imp::test<T, Args...>(0)) == sizeof(boost::type_traits::yes_type)>{};
|
||||
template <class T, class Arg> struct is_constructible<T, Arg> : public integral_constant<bool, is_destructible<T>::value && sizeof(detail::is_constructible_imp::test1<T, Arg>(0)) == sizeof(boost::type_traits::yes_type)>{};
|
||||
template <class Ref, class Arg> struct is_constructible<Ref&, Arg> : public integral_constant<bool, sizeof(detail::is_constructible_imp::ref_test<Ref&>(boost::declval<Arg>())) == sizeof(boost::type_traits::yes_type)>{};
|
||||
template <class Ref, class Arg> struct is_constructible<Ref&&, Arg> : public integral_constant<bool, sizeof(detail::is_constructible_imp::ref_test<Ref&&>(boost::declval<Arg>())) == sizeof(boost::type_traits::yes_type)>{};
|
||||
|
||||
template <> struct is_constructible<void> : public false_type{};
|
||||
template <> struct is_constructible<void const> : public false_type{};
|
||||
template <> struct is_constructible<void const volatile> : public false_type{};
|
||||
template <> struct is_constructible<void volatile> : public false_type{};
|
||||
|
||||
template <class T> struct is_constructible<T> : public is_default_constructible<T>{};
|
||||
|
||||
#else
|
||||
|
||||
@@ -44,8 +65,16 @@ namespace boost{
|
||||
// We don't know how to implement this:
|
||||
template <class T, class U = void> struct is_constructible : public is_convertible<U, T>{};
|
||||
template <class T> struct is_constructible<T, void> : public is_default_constructible<T>{};
|
||||
template <> struct is_constructible<void, void> : public false_type{};
|
||||
template <> struct is_constructible<void const, void> : public false_type{};
|
||||
template <> struct is_constructible<void const volatile, void> : public false_type{};
|
||||
template <> struct is_constructible<void volatile, void> : public false_type{};
|
||||
template <class Ref> struct is_constructible<Ref&, void> : public false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class Ref> struct is_constructible<Ref&&, void> : public false_type{};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_ASSIGNABLE_HPP_INCLUDED
|
||||
#endif // BOOST_TT_IS_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
@@ -54,7 +54,7 @@ namespace boost {
|
||||
|
||||
namespace detail {
|
||||
|
||||
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
|
||||
#if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !(defined(BOOST_GCC) && (BOOST_GCC < 40700))
|
||||
|
||||
// This is a C++11 conforming version, place this first and use it wherever possible:
|
||||
|
||||
|
||||
@@ -9,111 +9,170 @@
|
||||
#ifndef BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800) && !BOOST_WORKAROUND(BOOST_GCC_VERSION, < 40900)
|
||||
|
||||
#include <boost/type_traits/is_constructible.hpp>
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1800)
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <class T> struct is_copy_constructible : public boost::is_constructible<T, const T&>{};
|
||||
|
||||
template <> struct is_copy_constructible<void> : public false_type{};
|
||||
template <> struct is_copy_constructible<void const> : public false_type{};
|
||||
template <> struct is_copy_constructible<void const volatile> : public false_type{};
|
||||
template <> struct is_copy_constructible<void volatile> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#else
|
||||
//
|
||||
// Special version for VC12 which has a problem when a base class (such as non_copyable) has a deleted
|
||||
// copy constructor. In this case the compiler thinks there really is a copy-constructor and tries to
|
||||
// instantiate the deleted member. std::is_copy_constructible has the same issue (or at least returns
|
||||
// an incorrect value, which just defers the issue into the users code) as well. We can at least fix
|
||||
// boost::non_copyable as a base class as a special case:
|
||||
//
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail
|
||||
{
|
||||
|
||||
template <class T, bool b> struct is_copy_constructible_imp : public boost::is_constructible<T, const T&>{};
|
||||
template <class T> struct is_copy_constructible_imp<T, true> : public false_type{};
|
||||
|
||||
}
|
||||
|
||||
template <class T> struct is_copy_constructible : public detail::is_copy_constructible_imp<T, is_base_and_derived<boost::noncopyable, T>::value>{};
|
||||
|
||||
template <> struct is_copy_constructible<void> : public false_type{};
|
||||
template <> struct is_copy_constructible<void const> : public false_type{};
|
||||
template <> struct is_copy_constructible<void const volatile> : public false_type{};
|
||||
template <> struct is_copy_constructible<void volatile> : public false_type{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/type_traits/is_base_and_derived.hpp>
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
#include <boost/type_traits/is_rvalue_reference.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/type_traits/is_array.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace detail{
|
||||
namespace detail{
|
||||
|
||||
template <bool DerivedFromNoncopyable, class T>
|
||||
struct is_copy_constructible_impl2 {
|
||||
template <bool DerivedFromNoncopyable, class T>
|
||||
struct is_copy_constructible_impl2 {
|
||||
|
||||
// Intel compiler has problems with SFINAE for copy constructors and deleted functions:
|
||||
//
|
||||
// error: function *function_name* cannot be referenced -- it is a deleted function
|
||||
// static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
|
||||
// ^
|
||||
//
|
||||
// MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken
|
||||
// Intel compiler has problems with SFINAE for copy constructors and deleted functions:
|
||||
//
|
||||
// error: function *function_name* cannot be referenced -- it is a deleted function
|
||||
// static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
|
||||
// ^
|
||||
//
|
||||
// MSVC 12.0 (Visual 2013) has problems when the copy constructor has been deleted. See:
|
||||
// https://connect.microsoft.com/VisualStudio/feedback/details/800328/std-is-copy-constructible-is-broken
|
||||
#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) && !defined(BOOST_INTEL_CXX_VERSION) && !(defined(BOOST_MSVC) && _MSC_VER == 1800)
|
||||
|
||||
#ifdef BOOST_NO_CXX11_DECLTYPE
|
||||
template <class T1>
|
||||
static boost::type_traits::yes_type test(T1&, boost::mpl::int_<sizeof(T1(boost::declval<T1&>()))>* = 0);
|
||||
template <class T1>
|
||||
static boost::type_traits::yes_type test(const T1&, boost::mpl::int_<sizeof(T1(boost::declval<const T1&>()))>* = 0);
|
||||
#else
|
||||
template <class T1>
|
||||
static boost::type_traits::yes_type test(T1&, decltype(T1(boost::declval<T1&>()))* = 0);
|
||||
template <class T1>
|
||||
static boost::type_traits::yes_type test(const T1&, decltype(T1(boost::declval<const T1&>()))* = 0);
|
||||
#endif
|
||||
|
||||
static boost::type_traits::no_type test(...);
|
||||
static boost::type_traits::no_type test(...);
|
||||
#else
|
||||
template <class T1>
|
||||
static boost::type_traits::no_type test(T1&, typename T1::boost_move_no_copy_constructor_or_assign* = 0);
|
||||
static boost::type_traits::yes_type test(...);
|
||||
template <class T1>
|
||||
static boost::type_traits::no_type test(const T1&, typename T1::boost_move_no_copy_constructor_or_assign* = 0);
|
||||
static boost::type_traits::yes_type test(...);
|
||||
#endif
|
||||
|
||||
// If you see errors like this:
|
||||
//
|
||||
// `'T::T(const T&)' is private`
|
||||
// `boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context`
|
||||
//
|
||||
// then you are trying to call that macro for a structure defined like that:
|
||||
//
|
||||
// struct T {
|
||||
// ...
|
||||
// private:
|
||||
// T(const T &);
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// To fix that you must modify your structure:
|
||||
//
|
||||
// // C++03 and C++11 version
|
||||
// struct T: private boost::noncopyable {
|
||||
// ...
|
||||
// private:
|
||||
// T(const T &);
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// // C++11 version
|
||||
// struct T {
|
||||
// ...
|
||||
// private:
|
||||
// T(const T &) = delete;
|
||||
// ...
|
||||
// };
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
// If you see errors like this:
|
||||
//
|
||||
// `'T::T(const T&)' is private`
|
||||
// `boost/type_traits/is_copy_constructible.hpp:68:5: error: within this context`
|
||||
//
|
||||
// then you are trying to call that macro for a structure defined like that:
|
||||
//
|
||||
// struct T {
|
||||
// ...
|
||||
// private:
|
||||
// T(const T &);
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// To fix that you must modify your structure:
|
||||
//
|
||||
// // C++03 and C++11 version
|
||||
// struct T: private boost::noncopyable {
|
||||
// ...
|
||||
// private:
|
||||
// T(const T &);
|
||||
// ...
|
||||
// };
|
||||
//
|
||||
// // C++11 version
|
||||
// struct T {
|
||||
// ...
|
||||
// private:
|
||||
// T(const T &) = delete;
|
||||
// ...
|
||||
// };
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
sizeof(test(
|
||||
boost::declval<BOOST_DEDUCED_TYPENAME boost::add_reference<T>::type>()
|
||||
boost::declval<BOOST_DEDUCED_TYPENAME boost::add_reference<T const>::type>()
|
||||
)) == sizeof(boost::type_traits::yes_type)
|
||||
||
|
||||
boost::is_rvalue_reference<T>::value
|
||||
));
|
||||
};
|
||||
&&
|
||||
!boost::is_rvalue_reference<T>::value
|
||||
&& !boost::is_array<T>::value
|
||||
));
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_copy_constructible_impl2<true, T> {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
template <class T>
|
||||
struct is_copy_constructible_impl2<true, T> {
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct is_copy_constructible_impl {
|
||||
template <class T>
|
||||
struct is_copy_constructible_impl {
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
boost::detail::is_copy_constructible_impl2<
|
||||
BOOST_STATIC_CONSTANT(bool, value = (
|
||||
boost::detail::is_copy_constructible_impl2<
|
||||
boost::is_base_and_derived<boost::noncopyable, T>::value,
|
||||
T
|
||||
>::value
|
||||
));
|
||||
};
|
||||
>::value
|
||||
));
|
||||
};
|
||||
|
||||
} // namespace detail
|
||||
} // namespace detail
|
||||
|
||||
template <class T> struct is_copy_constructible : public integral_constant<bool, ::boost::detail::is_copy_constructible_impl<T>::value>{};
|
||||
template <> struct is_copy_constructible<void> : public false_type{};
|
||||
template <class T> struct is_copy_constructible : public integral_constant<bool, ::boost::detail::is_copy_constructible_impl<T>::value>{};
|
||||
template <> struct is_copy_constructible<void> : public false_type{};
|
||||
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
|
||||
template <> struct is_copy_constructible<void const> : public false_type{};
|
||||
template <> struct is_copy_constructible<void volatile> : public false_type{};
|
||||
template <> struct is_copy_constructible<void const volatile> : public false_type{};
|
||||
template <> struct is_copy_constructible<void const> : public false_type{};
|
||||
template <> struct is_copy_constructible<void volatile> : public false_type{};
|
||||
template <> struct is_copy_constructible<void const volatile> : public false_type{};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BOOST_TT_IS_COPY_CONSTRUCTIBLE_HPP_INCLUDED
|
||||
@@ -43,12 +43,13 @@ namespace boost{
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/has_trivial_constructor.hpp>
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
// We don't know how to implement this:
|
||||
template <class T> struct is_default_constructible : public has_trivial_constructor<T>{};
|
||||
// We don't know how to implement this, note we can not use has_trivial_constructor here
|
||||
// because the correct implementation of that trait requires this one:
|
||||
template <class T> struct is_default_constructible : public is_pod<T>{};
|
||||
template <> struct is_default_constructible<void> : public integral_constant<bool, false>{};
|
||||
template <> struct is_default_constructible<void const> : public integral_constant<bool, false>{};
|
||||
template <> struct is_default_constructible<void volatile> : public integral_constant<bool, false>{};
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
// (C) Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the Boost Software License,
|
||||
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt).
|
||||
//
|
||||
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
|
||||
|
||||
#ifndef BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED
|
||||
#define BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED
|
||||
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1800)
|
||||
|
||||
#include <boost/type_traits/detail/yes_no_type.hpp>
|
||||
#include <boost/type_traits/declval.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace detail{
|
||||
|
||||
struct is_destructible_imp
|
||||
{
|
||||
template<typename T, typename = decltype(boost::declval<T&>().~T())>
|
||||
static boost::type_traits::yes_type test(int);
|
||||
template<typename>
|
||||
static boost::type_traits::no_type test(...);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
template <class T> struct is_destructible : public integral_constant<bool, sizeof(detail::is_destructible_imp::test<T>(0)) == sizeof(boost::type_traits::yes_type)>{};
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/is_pod.hpp>
|
||||
#include <boost/type_traits/is_class.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
// We don't know how to implement this:
|
||||
template <class T> struct is_destructible : public integral_constant<bool, is_pod<T>::value || is_class<T>::value>{};
|
||||
#endif
|
||||
|
||||
template <> struct is_destructible<void> : public false_type{};
|
||||
template <> struct is_destructible<void const> : public false_type{};
|
||||
template <> struct is_destructible<void volatile> : public false_type{};
|
||||
template <> struct is_destructible<void const volatile> : public false_type{};
|
||||
template <class T> struct is_destructible<T&> : public is_destructible<T>{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct is_destructible<T&&> : public is_destructible<T>{};
|
||||
#endif
|
||||
template <class T, std::size_t N> struct is_destructible<T[N]> : public is_destructible<T>{};
|
||||
template <class T> struct is_destructible<T[]> : public is_destructible<T>{};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TT_IS_DESTRUCTIBLE_HPP_INCLUDED
|
||||
@@ -24,10 +24,6 @@ struct is_nothrow_move_constructible : public integral_constant<bool, BOOST_IS_N
|
||||
|
||||
template <class T> struct is_nothrow_move_constructible<volatile T> : public ::boost::false_type {};
|
||||
template <class T> struct is_nothrow_move_constructible<const volatile T> : public ::boost::false_type{};
|
||||
template <class T> struct is_nothrow_move_constructible<T&> : public ::boost::false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::false_type{};
|
||||
#endif
|
||||
|
||||
#elif !defined(BOOST_NO_CXX11_NOEXCEPT) && !defined(BOOST_NO_SFINAE_EXPR)
|
||||
|
||||
@@ -53,10 +49,8 @@ template <class T> struct is_nothrow_move_constructible
|
||||
|
||||
template <class T> struct is_nothrow_move_constructible<volatile T> : public ::boost::false_type {};
|
||||
template <class T> struct is_nothrow_move_constructible<const volatile T> : public ::boost::false_type{};
|
||||
template <class T> struct is_nothrow_move_constructible<T&> : public ::boost::false_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::false_type{};
|
||||
#endif
|
||||
template <class T, std::size_t N> struct is_nothrow_move_constructible<T[N]> : public ::boost::false_type{};
|
||||
template <class T> struct is_nothrow_move_constructible<T[]> : public ::boost::false_type{};
|
||||
|
||||
#else
|
||||
|
||||
@@ -80,6 +74,11 @@ template <> struct is_nothrow_move_constructible<void const> : false_type{};
|
||||
template <> struct is_nothrow_move_constructible<void volatile> : false_type{};
|
||||
template <> struct is_nothrow_move_constructible<void const volatile> : false_type{};
|
||||
#endif
|
||||
// References are always trivially constructible, even if the thing they reference is not:
|
||||
template <class T> struct is_nothrow_move_constructible<T&> : public ::boost::true_type{};
|
||||
#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
|
||||
template <class T> struct is_nothrow_move_constructible<T&&> : public ::boost::true_type{};
|
||||
#endif
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
#include <boost/type_traits/is_scalar.hpp>
|
||||
#include <boost/type_traits/intrinsics.hpp>
|
||||
|
||||
#ifdef __SUNPRO_CC
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#endif
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#ifndef BOOST_IS_POD
|
||||
|
||||
Reference in new issue
Block a user