YANZ UPLOAD ANJG
// C++11 -*- C++ -*-
// Copyright (C) 2007-2021 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// .
/** @file include/type_traits
* This is a Standard C++ Library header.
*/
#ifndef _GLIBCXX_TYPE_TRAITS
#define _GLIBCXX_TYPE_TRAITS 1
#pragma GCC system_header
#if __cplusplus < 201103L
# include
#else
#include
namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
template
class tuple;
template
class reference_wrapper;
/**
* @defgroup metaprogramming Metaprogramming
* @ingroup utilities
*
* Template utilities for compile-time introspection and modification,
* including type classification traits, type property inspection traits
* and type transformation traits.
*
* @since C++11
*
* @{
*/
/// integral_constant
template
struct integral_constant
{
static constexpr _Tp value = __v;
typedef _Tp value_type;
typedef integral_constant<_Tp, __v> type;
constexpr operator value_type() const noexcept { return value; }
#if __cplusplus > 201103L
#define __cpp_lib_integral_constant_callable 201304
constexpr value_type operator()() const noexcept { return value; }
#endif
};
template
constexpr _Tp integral_constant<_Tp, __v>::value;
/// The type used as a compile-time boolean with true value.
using true_type = integral_constant;
/// The type used as a compile-time boolean with false value.
using false_type = integral_constant;
/// @cond undocumented
/// bool_constant for C++11
template
using __bool_constant = integral_constant;
/// @endcond
#if __cplusplus >= 201703L
# define __cpp_lib_bool_constant 201505
/// Alias template for compile-time boolean constant types.
/// @since C++17
template
using bool_constant = integral_constant;
#endif
// Metaprogramming helper types.
template
struct conditional;
/// @cond undocumented
template
struct __type_identity
{ using type = _Type; };
template
using __type_identity_t = typename __type_identity<_Tp>::type;
template
struct __or_;
template<>
struct __or_<>
: public false_type
{ };
template
struct __or_<_B1>
: public _B1
{ };
template
struct __or_<_B1, _B2>
: public conditional<_B1::value, _B1, _B2>::type
{ };
template
struct __or_<_B1, _B2, _B3, _Bn...>
: public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
{ };
template
struct __and_;
template<>
struct __and_<>
: public true_type
{ };
template
struct __and_<_B1>
: public _B1
{ };
template
struct __and_<_B1, _B2>
: public conditional<_B1::value, _B2, _B1>::type
{ };
template
struct __and_<_B1, _B2, _B3, _Bn...>
: public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
{ };
template
struct __not_
: public __bool_constant
{ };
/// @endcond
#if __cplusplus >= 201703L
/// @cond undocumented
template
inline constexpr bool __or_v = __or_<_Bn...>::value;
template
inline constexpr bool __and_v = __and_<_Bn...>::value;
/// @endcond
#define __cpp_lib_logical_traits 201510
template
struct conjunction
: __and_<_Bn...>
{ };
template
struct disjunction
: __or_<_Bn...>
{ };
template
struct negation
: __not_<_Pp>
{ };
/** @ingroup variable_templates
* @{
*/
template
inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
template
inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
template
inline constexpr bool negation_v = negation<_Pp>::value;
/// @}
#endif // C++17
// Forward declarations
template
struct is_reference;
template
struct is_function;
template
struct is_void;
template
struct remove_cv;
template
struct is_const;
/// @cond undocumented
template
struct __is_array_unknown_bounds;
// Helper functions that return false_type for incomplete classes,
// incomplete unions and arrays of known bound from those.
template
constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>)
{ return {}; }
template
constexpr typename __or_<
is_reference<_NestedType>,
is_function<_NestedType>,
is_void<_NestedType>,
__is_array_unknown_bounds<_NestedType>
>::type __is_complete_or_unbounded(_TypeIdentity)
{ return {}; }
// For several sfinae-friendly trait implementations we transport both the
// result information (as the member type) and the failure information (no
// member type). This is very similar to std::enable_if, but we cannot use
// them, because we need to derive from them as an implementation detail.
template
struct __success_type
{ typedef _Tp type; };
struct __failure_type
{ };
// __remove_cv_t (std::remove_cv_t for C++11).
template
using __remove_cv_t = typename remove_cv<_Tp>::type;
// Primary type categories.
template
struct __is_void_helper
: public false_type { };
template<>
struct __is_void_helper
: public true_type { };
/// @endcond
/// is_void
template
struct is_void
: public __is_void_helper<__remove_cv_t<_Tp>>::type
{ };
/// @cond undocumented
template
struct __is_integral_helper
: public false_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
// We want is_integral to be true (and make_signed/unsigned to work)
// even when libc doesn't provide working and related functions,
// so check __WCHAR_TYPE__ instead of _GLIBCXX_USE_WCHAR_T.
#ifdef __WCHAR_TYPE__
template<>
struct __is_integral_helper
: public true_type { };
#endif
#ifdef _GLIBCXX_USE_CHAR8_T
template<>
struct __is_integral_helper
: public true_type { };
#endif
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
// Conditionalizing on __STRICT_ANSI__ here will break any port that
// uses one of these types for size_t.
#if defined(__GLIBCXX_TYPE_INT_N_0)
template<>
struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
#endif
#if defined(__GLIBCXX_TYPE_INT_N_1)
template<>
struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
#endif
#if defined(__GLIBCXX_TYPE_INT_N_2)
template<>
struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
#endif
#if defined(__GLIBCXX_TYPE_INT_N_3)
template<>
struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
: public true_type { };
template<>
struct __is_integral_helper
: public true_type { };
#endif
/// @endcond
/// is_integral
template
struct is_integral
: public __is_integral_helper<__remove_cv_t<_Tp>>::type
{ };
/// @cond undocumented
template
struct __is_floating_point_helper
: public false_type { };
template<>
struct __is_floating_point_helper
: public true_type { };
template<>
struct __is_floating_point_helper
: public true_type { };
template<>
struct __is_floating_point_helper
: public true_type { };
#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
template<>
struct __is_floating_point_helper<__float128>
: public true_type { };
#endif
/// @endcond
/// is_floating_point
template
struct is_floating_point
: public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
{ };
/// is_array
template
struct is_array
: public false_type { };
template
struct is_array<_Tp[_Size]>
: public true_type { };
template
struct is_array<_Tp[]>
: public true_type { };
template
struct __is_pointer_helper
: public false_type { };
template
struct __is_pointer_helper<_Tp*>
: public true_type { };
/// is_pointer
template
struct is_pointer
: public __is_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
/// is_lvalue_reference
template
struct is_lvalue_reference
: public false_type { };
template
struct is_lvalue_reference<_Tp&>
: public true_type { };
/// is_rvalue_reference
template
struct is_rvalue_reference
: public false_type { };
template
struct is_rvalue_reference<_Tp&&>
: public true_type { };
template
struct __is_member_object_pointer_helper
: public false_type { };
template
struct __is_member_object_pointer_helper<_Tp _Cp::*>
: public __not_>::type { };
/// is_member_object_pointer
template
struct is_member_object_pointer
: public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
template
struct __is_member_function_pointer_helper
: public false_type { };
template
struct __is_member_function_pointer_helper<_Tp _Cp::*>
: public is_function<_Tp>::type { };
/// is_member_function_pointer
template
struct is_member_function_pointer
: public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
/// is_enum
template
struct is_enum
: public integral_constant
{ };
/// is_union
template
struct is_union
: public integral_constant
{ };
/// is_class
template
struct is_class
: public integral_constant
{ };
/// is_function
template
struct is_function
: public __bool_constant::value> { };
template
struct is_function<_Tp&>
: public false_type { };
template
struct is_function<_Tp&&>
: public false_type { };
#define __cpp_lib_is_null_pointer 201309
template
struct __is_null_pointer_helper
: public false_type { };
template<>
struct __is_null_pointer_helper
: public true_type { };
/// is_null_pointer (LWG 2247).
template
struct is_null_pointer
: public __is_null_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
/// __is_nullptr_t (deprecated extension).
/// @deprecated Use `is_null_pointer` instead.
template
struct __is_nullptr_t
: public is_null_pointer<_Tp>
{ } _GLIBCXX_DEPRECATED_SUGGEST("std::is_null_pointer");
// Composite type categories.
/// is_reference
template
struct is_reference
: public __or_,
is_rvalue_reference<_Tp>>::type
{ };
/// is_arithmetic
template
struct is_arithmetic
: public __or_, is_floating_point<_Tp>>::type
{ };
/// is_fundamental
template
struct is_fundamental
: public __or_, is_void<_Tp>,
is_null_pointer<_Tp>>::type
{ };
/// is_object
template
struct is_object
: public __not_<__or_, is_reference<_Tp>,
is_void<_Tp>>>::type
{ };
template
struct is_member_pointer;
/// is_scalar
template
struct is_scalar
: public __or_, is_enum<_Tp>, is_pointer<_Tp>,
is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
{ };
/// is_compound
template
struct is_compound
: public __not_>::type { };
/// @cond undocumented
template
struct __is_member_pointer_helper
: public false_type { };
template
struct __is_member_pointer_helper<_Tp _Cp::*>
: public true_type { };
/// @endcond
/// is_member_pointer
template
struct is_member_pointer
: public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
{ };
template
struct is_same;
/// @cond undocumented
template
using __is_one_of = __or_...>;
// Check if a type is one of the signed integer types.
template
using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
signed char, signed short, signed int, signed long,
signed long long
#if defined(__GLIBCXX_TYPE_INT_N_0)
, signed __GLIBCXX_TYPE_INT_N_0
#endif
#if defined(__GLIBCXX_TYPE_INT_N_1)
, signed __GLIBCXX_TYPE_INT_N_1
#endif
#if defined(__GLIBCXX_TYPE_INT_N_2)
, signed __GLIBCXX_TYPE_INT_N_2
#endif
#if defined(__GLIBCXX_TYPE_INT_N_3)
, signed __GLIBCXX_TYPE_INT_N_3
#endif
>;
// Check if a type is one of the unsigned integer types.
template
using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
unsigned char, unsigned short, unsigned int, unsigned long,
unsigned long long
#if defined(__GLIBCXX_TYPE_INT_N_0)
, unsigned __GLIBCXX_TYPE_INT_N_0
#endif
#if defined(__GLIBCXX_TYPE_INT_N_1)
, unsigned __GLIBCXX_TYPE_INT_N_1
#endif
#if defined(__GLIBCXX_TYPE_INT_N_2)
, unsigned __GLIBCXX_TYPE_INT_N_2
#endif
#if defined(__GLIBCXX_TYPE_INT_N_3)
, unsigned __GLIBCXX_TYPE_INT_N_3
#endif
>;
// Check if a type is one of the signed or unsigned integer types.
template
using __is_standard_integer
= __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
// __void_t (std::void_t for C++11)
template using __void_t = void;
// Utility to detect referenceable types ([defns.referenceable]).
template
struct __is_referenceable
: public false_type
{ };
template
struct __is_referenceable<_Tp, __void_t<_Tp&>>
: public true_type
{ };
/// @endcond
// Type properties.
/// is_const
template
struct is_const
: public false_type { };
template
struct is_const<_Tp const>
: public true_type { };
/// is_volatile
template
struct is_volatile
: public false_type { };
template
struct is_volatile<_Tp volatile>
: public true_type { };
/// is_trivial
template
struct is_trivial
: public integral_constant
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_trivially_copyable
template
struct is_trivially_copyable
: public integral_constant
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_standard_layout
template
struct is_standard_layout
: public integral_constant
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/** is_pod (deprecated in C++20)
* @deprecated Use `is_standard_layout && is_trivial` instead.
*/
// Could use is_standard_layout && is_trivial instead of the builtin.
template
struct
_GLIBCXX20_DEPRECATED("use is_standard_layout && is_trivial instead")
is_pod
: public integral_constant
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/** is_literal_type
* @deprecated Deprecated in C++20. The idea of a literal type isn't useful.
*/
template
struct
_GLIBCXX17_DEPRECATED
is_literal_type
: public integral_constant
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_empty
template
struct is_empty
: public integral_constant
{ };
/// is_polymorphic
template
struct is_polymorphic
: public integral_constant
{ };
#if __cplusplus >= 201402L
#define __cpp_lib_is_final 201402L
/// is_final
/// @since C++14
template
struct is_final
: public integral_constant
{ };
#endif
/// is_abstract
template
struct is_abstract
: public integral_constant
{ };
/// @cond undocumented
template::value>
struct __is_signed_helper
: public false_type { };
template
struct __is_signed_helper<_Tp, true>
: public integral_constant
{ };
/// @endcond
/// is_signed
template
struct is_signed
: public __is_signed_helper<_Tp>::type
{ };
/// is_unsigned
template
struct is_unsigned
: public __and_, __not_>>
{ };
/// @cond undocumented
template
_Up
__declval(int);
template
_Tp
__declval(long);
/// @endcond
template
auto declval() noexcept -> decltype(__declval<_Tp>(0));
template
struct extent;
template
struct remove_all_extents;
/// @cond undocumented
template
struct __is_array_known_bounds
: public integral_constant::value > 0)>
{ };
template
struct __is_array_unknown_bounds
: public __and_, __not_>>
{ };
// Destructible and constructible type properties.
// In N3290 is_destructible does not say anything about function
// types and abstract types, see LWG 2049. This implementation
// describes function types as non-destructible and all complete
// object types as destructible, iff the explicit destructor
// call expression is wellformed.
struct __do_is_destructible_impl
{
template().~_Tp())>
static true_type __test(int);
template
static false_type __test(...);
};
template
struct __is_destructible_impl
: public __do_is_destructible_impl
{
typedef decltype(__test<_Tp>(0)) type;
};
template,
__is_array_unknown_bounds<_Tp>,
is_function<_Tp>>::value,
bool = __or_, is_scalar<_Tp>>::value>
struct __is_destructible_safe;
template
struct __is_destructible_safe<_Tp, false, false>
: public __is_destructible_impl::type>::type
{ };
template
struct __is_destructible_safe<_Tp, true, false>
: public false_type { };
template
struct __is_destructible_safe<_Tp, false, true>
: public true_type { };
/// @endcond
/// is_destructible
template
struct is_destructible
: public __is_destructible_safe<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// @cond undocumented
// is_nothrow_destructible requires that is_destructible is
// satisfied as well. We realize that by mimicing the
// implementation of is_destructible but refer to noexcept(expr)
// instead of decltype(expr).
struct __do_is_nt_destructible_impl
{
template
static __bool_constant().~_Tp())>
__test(int);
template
static false_type __test(...);
};
template
struct __is_nt_destructible_impl
: public __do_is_nt_destructible_impl
{
typedef decltype(__test<_Tp>(0)) type;
};
template,
__is_array_unknown_bounds<_Tp>,
is_function<_Tp>>::value,
bool = __or_, is_scalar<_Tp>>::value>
struct __is_nt_destructible_safe;
template
struct __is_nt_destructible_safe<_Tp, false, false>
: public __is_nt_destructible_impl::type>::type
{ };
template
struct __is_nt_destructible_safe<_Tp, true, false>
: public false_type { };
template
struct __is_nt_destructible_safe<_Tp, false, true>
: public true_type { };
/// @endcond
/// is_nothrow_destructible
template
struct is_nothrow_destructible
: public __is_nt_destructible_safe<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// @cond undocumented
template
struct __is_constructible_impl
: public __bool_constant<__is_constructible(_Tp, _Args...)>
{ };
/// @endcond
/// is_constructible
template
struct is_constructible
: public __is_constructible_impl<_Tp, _Args...>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_default_constructible
template
struct is_default_constructible
: public __is_constructible_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// @cond undocumented
template::value>
struct __is_copy_constructible_impl;
template
struct __is_copy_constructible_impl<_Tp, false>
: public false_type { };
template
struct __is_copy_constructible_impl<_Tp, true>
: public __is_constructible_impl<_Tp, const _Tp&>
{ };
/// @endcond
/// is_copy_constructible
template
struct is_copy_constructible
: public __is_copy_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// @cond undocumented
template::value>
struct __is_move_constructible_impl;
template
struct __is_move_constructible_impl<_Tp, false>
: public false_type { };
template
struct __is_move_constructible_impl<_Tp, true>
: public __is_constructible_impl<_Tp, _Tp&&>
{ };
/// @endcond
/// is_move_constructible
template
struct is_move_constructible
: public __is_move_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// @cond undocumented
template
using __is_nothrow_constructible_impl
= __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
/// @endcond
/// is_nothrow_constructible
template
struct is_nothrow_constructible
: public __is_nothrow_constructible_impl<_Tp, _Args...>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_nothrow_default_constructible
template
struct is_nothrow_default_constructible
: public __bool_constant<__is_nothrow_constructible(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// @cond undocumented
template::value>
struct __is_nothrow_copy_constructible_impl;
template
struct __is_nothrow_copy_constructible_impl<_Tp, false>
: public false_type { };
template
struct __is_nothrow_copy_constructible_impl<_Tp, true>
: public __is_nothrow_constructible_impl<_Tp, const _Tp&>
{ };
/// @endcond
/// is_nothrow_copy_constructible
template
struct is_nothrow_copy_constructible
: public __is_nothrow_copy_constructible_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// @cond undocumented
template::value>
struct __is_nothrow_move_constructible_impl;
template
struct __is_nothrow_move_constructible_impl<_Tp, false>
: public false_type { };
template
struct __is_nothrow_move_constructible_impl<_Tp, true>
: public __is_nothrow_constructible_impl<_Tp, _Tp&&>
{ };
/// @endcond
/// is_nothrow_move_constructible
template
struct is_nothrow_move_constructible
: public __is_nothrow_move_constructible_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_assignable
template
struct is_assignable
: public __bool_constant<__is_assignable(_Tp, _Up)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template::value>
struct __is_copy_assignable_impl;
template
struct __is_copy_assignable_impl<_Tp, false>
: public false_type { };
template
struct __is_copy_assignable_impl<_Tp, true>
: public __bool_constant<__is_assignable(_Tp&, const _Tp&)>
{ };
/// is_copy_assignable
template
struct is_copy_assignable
: public __is_copy_assignable_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template::value>
struct __is_move_assignable_impl;
template
struct __is_move_assignable_impl<_Tp, false>
: public false_type { };
template
struct __is_move_assignable_impl<_Tp, true>
: public __bool_constant<__is_assignable(_Tp&, _Tp&&)>
{ };
/// is_move_assignable
template
struct is_move_assignable
: public __is_move_assignable_impl<_Tp>::type
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template
using __is_nothrow_assignable_impl
= __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
/// is_nothrow_assignable
template
struct is_nothrow_assignable
: public __is_nothrow_assignable_impl<_Tp, _Up>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template::value>
struct __is_nt_copy_assignable_impl;
template
struct __is_nt_copy_assignable_impl<_Tp, false>
: public false_type { };
template
struct __is_nt_copy_assignable_impl<_Tp, true>
: public __is_nothrow_assignable_impl<_Tp&, const _Tp&>
{ };
/// is_nothrow_copy_assignable
template
struct is_nothrow_copy_assignable
: public __is_nt_copy_assignable_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template::value>
struct __is_nt_move_assignable_impl;
template
struct __is_nt_move_assignable_impl<_Tp, false>
: public false_type { };
template
struct __is_nt_move_assignable_impl<_Tp, true>
: public __is_nothrow_assignable_impl<_Tp&, _Tp&&>
{ };
/// is_nothrow_move_assignable
template
struct is_nothrow_move_assignable
: public __is_nt_move_assignable_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_trivially_constructible
template
struct is_trivially_constructible
: public __bool_constant<__is_trivially_constructible(_Tp, _Args...)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_trivially_default_constructible
template
struct is_trivially_default_constructible
: public __bool_constant<__is_trivially_constructible(_Tp)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
struct __do_is_implicitly_default_constructible_impl
{
template
static void __helper(const _Tp&);
template
static true_type __test(const _Tp&,
decltype(__helper({}))* = 0);
static false_type __test(...);
};
template
struct __is_implicitly_default_constructible_impl
: public __do_is_implicitly_default_constructible_impl
{
typedef decltype(__test(declval<_Tp>())) type;
};
template
struct __is_implicitly_default_constructible_safe
: public __is_implicitly_default_constructible_impl<_Tp>::type
{ };
template
struct __is_implicitly_default_constructible
: public __and_<__is_constructible_impl<_Tp>,
__is_implicitly_default_constructible_safe<_Tp>>
{ };
template::value>
struct __is_trivially_copy_constructible_impl;
template
struct __is_trivially_copy_constructible_impl<_Tp, false>
: public false_type { };
template
struct __is_trivially_copy_constructible_impl<_Tp, true>
: public __and_<__is_copy_constructible_impl<_Tp>,
integral_constant>
{ };
/// is_trivially_copy_constructible
template
struct is_trivially_copy_constructible
: public __is_trivially_copy_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template::value>
struct __is_trivially_move_constructible_impl;
template
struct __is_trivially_move_constructible_impl<_Tp, false>
: public false_type { };
template
struct __is_trivially_move_constructible_impl<_Tp, true>
: public __and_<__is_move_constructible_impl<_Tp>,
integral_constant>
{ };
/// is_trivially_move_constructible
template
struct is_trivially_move_constructible
: public __is_trivially_move_constructible_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
/// is_trivially_assignable
template
struct is_trivially_assignable
: public __bool_constant<__is_trivially_assignable(_Tp, _Up)>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template::value>
struct __is_trivially_copy_assignable_impl;
template
struct __is_trivially_copy_assignable_impl<_Tp, false>
: public false_type { };
template
struct __is_trivially_copy_assignable_impl<_Tp, true>
: public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)>
{ };
/// is_trivially_copy_assignable
template
struct is_trivially_copy_assignable
: public __is_trivially_copy_assignable_impl<_Tp>
{
static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
"template argument must be a complete class or an unbounded array");
};
template