type_traits revision 260015
1227825Stheraven// -*- C++ -*- 2227825Stheraven//===------------------------ type_traits ---------------------------------===// 3227825Stheraven// 4227825Stheraven// The LLVM Compiler Infrastructure 5227825Stheraven// 6227825Stheraven// This file is dual licensed under the MIT and the University of Illinois Open 7227825Stheraven// Source Licenses. See LICENSE.TXT for details. 8227825Stheraven// 9227825Stheraven//===----------------------------------------------------------------------===// 10227825Stheraven 11227825Stheraven#ifndef _LIBCPP_TYPE_TRAITS 12227825Stheraven#define _LIBCPP_TYPE_TRAITS 13227825Stheraven 14227825Stheraven/* 15227825Stheraven type_traits synopsis 16227825Stheraven 17227825Stheravennamespace std 18227825Stheraven{ 19227825Stheraven 20227825Stheraven // helper class: 21227825Stheraven template <class T, T v> struct integral_constant; 22227825Stheraven typedef integral_constant<bool, true> true_type; 23227825Stheraven typedef integral_constant<bool, false> false_type; 24227825Stheraven 25227825Stheraven // helper traits 26227825Stheraven template <bool, class T = void> struct enable_if; 27227825Stheraven template <bool, class T, class F> struct conditional; 28227825Stheraven 29227825Stheraven // Primary classification traits: 30227825Stheraven template <class T> struct is_void; 31227825Stheraven template <class T> struct is_integral; 32227825Stheraven template <class T> struct is_floating_point; 33227825Stheraven template <class T> struct is_array; 34227825Stheraven template <class T> struct is_pointer; 35227825Stheraven template <class T> struct is_lvalue_reference; 36227825Stheraven template <class T> struct is_rvalue_reference; 37227825Stheraven template <class T> struct is_member_object_pointer; 38227825Stheraven template <class T> struct is_member_function_pointer; 39227825Stheraven template <class T> struct is_enum; 40227825Stheraven template <class T> struct is_union; 41227825Stheraven template <class T> struct is_class; 42227825Stheraven template <class T> struct is_function; 43227825Stheraven 44227825Stheraven // Secondary classification traits: 45227825Stheraven template <class T> struct is_reference; 46227825Stheraven template <class T> struct is_arithmetic; 47227825Stheraven template <class T> struct is_fundamental; 48227825Stheraven template <class T> struct is_member_pointer; 49227825Stheraven template <class T> struct is_scalar; 50227825Stheraven template <class T> struct is_object; 51227825Stheraven template <class T> struct is_compound; 52227825Stheraven 53227825Stheraven // Const-volatile properties and transformations: 54227825Stheraven template <class T> struct is_const; 55227825Stheraven template <class T> struct is_volatile; 56227825Stheraven template <class T> struct remove_const; 57227825Stheraven template <class T> struct remove_volatile; 58227825Stheraven template <class T> struct remove_cv; 59227825Stheraven template <class T> struct add_const; 60227825Stheraven template <class T> struct add_volatile; 61227825Stheraven template <class T> struct add_cv; 62227825Stheraven 63227825Stheraven // Reference transformations: 64227825Stheraven template <class T> struct remove_reference; 65227825Stheraven template <class T> struct add_lvalue_reference; 66227825Stheraven template <class T> struct add_rvalue_reference; 67227825Stheraven 68227825Stheraven // Pointer transformations: 69227825Stheraven template <class T> struct remove_pointer; 70227825Stheraven template <class T> struct add_pointer; 71227825Stheraven 72227825Stheraven // Integral properties: 73227825Stheraven template <class T> struct is_signed; 74227825Stheraven template <class T> struct is_unsigned; 75227825Stheraven template <class T> struct make_signed; 76227825Stheraven template <class T> struct make_unsigned; 77227825Stheraven 78227825Stheraven // Array properties and transformations: 79227825Stheraven template <class T> struct rank; 80227825Stheraven template <class T, unsigned I = 0> struct extent; 81227825Stheraven template <class T> struct remove_extent; 82227825Stheraven template <class T> struct remove_all_extents; 83227825Stheraven 84227825Stheraven // Member introspection: 85227825Stheraven template <class T> struct is_pod; 86227825Stheraven template <class T> struct is_trivial; 87227825Stheraven template <class T> struct is_trivially_copyable; 88227825Stheraven template <class T> struct is_standard_layout; 89227825Stheraven template <class T> struct is_literal_type; 90227825Stheraven template <class T> struct is_empty; 91227825Stheraven template <class T> struct is_polymorphic; 92227825Stheraven template <class T> struct is_abstract; 93227825Stheraven 94227825Stheraven template <class T, class... Args> struct is_constructible; 95227825Stheraven template <class T> struct is_default_constructible; 96227825Stheraven template <class T> struct is_copy_constructible; 97227825Stheraven template <class T> struct is_move_constructible; 98227825Stheraven template <class T, class U> struct is_assignable; 99227825Stheraven template <class T> struct is_copy_assignable; 100227825Stheraven template <class T> struct is_move_assignable; 101227825Stheraven template <class T> struct is_destructible; 102227825Stheraven 103227825Stheraven template <class T, class... Args> struct is_trivially_constructible; 104227825Stheraven template <class T> struct is_trivially_default_constructible; 105227825Stheraven template <class T> struct is_trivially_copy_constructible; 106227825Stheraven template <class T> struct is_trivially_move_constructible; 107227825Stheraven template <class T, class U> struct is_trivially_assignable; 108227825Stheraven template <class T> struct is_trivially_copy_assignable; 109227825Stheraven template <class T> struct is_trivially_move_assignable; 110227825Stheraven template <class T> struct is_trivially_destructible; 111227825Stheraven 112227825Stheraven template <class T, class... Args> struct is_nothrow_constructible; 113227825Stheraven template <class T> struct is_nothrow_default_constructible; 114227825Stheraven template <class T> struct is_nothrow_copy_constructible; 115227825Stheraven template <class T> struct is_nothrow_move_constructible; 116227825Stheraven template <class T, class U> struct is_nothrow_assignable; 117227825Stheraven template <class T> struct is_nothrow_copy_assignable; 118227825Stheraven template <class T> struct is_nothrow_move_assignable; 119227825Stheraven template <class T> struct is_nothrow_destructible; 120227825Stheraven 121227825Stheraven template <class T> struct has_virtual_destructor; 122227825Stheraven 123227825Stheraven // Relationships between types: 124227825Stheraven template <class T, class U> struct is_same; 125227825Stheraven template <class Base, class Derived> struct is_base_of; 126227825Stheraven template <class From, class To> struct is_convertible; 127227825Stheraven 128227825Stheraven // Alignment properties and transformations: 129227825Stheraven template <class T> struct alignment_of; 130227825Stheraven template <size_t Len, size_t Align = most_stringent_alignment_requirement> 131227825Stheraven struct aligned_storage; 132249998Sdim template <size_t Len, class... Types> struct aligned_union; 133227825Stheraven 134227825Stheraven template <class T> struct decay; 135227825Stheraven template <class... T> struct common_type; 136227825Stheraven template <class T> struct underlying_type; 137227825Stheraven template <class> class result_of; // undefined 138227825Stheraven template <class Fn, class... ArgTypes> class result_of<Fn(ArgTypes...)>; 139227825Stheraven 140253159Stheraven // const-volatile modifications: 141253159Stheraven template <class T> 142253159Stheraven using remove_const_t = typename remove_const<T>::type; // C++14 143253159Stheraven template <class T> 144253159Stheraven using remove_volatile_t = typename remove_volatile<T>::type; // C++14 145253159Stheraven template <class T> 146253159Stheraven using remove_cv_t = typename remove_cv<T>::type; // C++14 147253159Stheraven template <class T> 148253159Stheraven using add_const_t = typename add_const<T>::type; // C++14 149253159Stheraven template <class T> 150253159Stheraven using add_volatile_t = typename add_volatile<T>::type; // C++14 151253159Stheraven template <class T> 152253159Stheraven using add_cv_t = typename add_cv<T>::type; // C++14 153253159Stheraven 154253159Stheraven // reference modifications: 155253159Stheraven template <class T> 156253159Stheraven using remove_reference_t = typename remove_reference<T>::type; // C++14 157253159Stheraven template <class T> 158253159Stheraven using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++14 159253159Stheraven template <class T> 160253159Stheraven using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++14 161253159Stheraven 162253159Stheraven // sign modifications: 163253159Stheraven template <class T> 164253159Stheraven using make_signed_t = typename make_signed<T>::type; // C++14 165253159Stheraven template <class T> 166253159Stheraven using make_unsigned_t = typename make_unsigned<T>::type; // C++14 167253159Stheraven 168253159Stheraven // array modifications: 169253159Stheraven template <class T> 170253159Stheraven using remove_extent_t = typename remove_extent<T>::type; // C++14 171253159Stheraven template <class T> 172253159Stheraven using remove_all_extents_t = typename remove_all_extents<T>::type; // C++14 173253159Stheraven 174253159Stheraven // pointer modifications: 175253159Stheraven template <class T> 176253159Stheraven using remove_pointer_t = typename remove_pointer<T>::type; // C++14 177253159Stheraven template <class T> 178253159Stheraven using add_pointer_t = typename add_pointer<T>::type; // C++14 179253159Stheraven 180253159Stheraven // other transformations: 181253159Stheraven template <size_t Len, std::size_t Align=default-alignment> 182253159Stheraven using aligned_storage_t = typename aligned_storage<Len,Align>::type; // C++14 183253159Stheraven template <std::size_t Len, class... Types> 184253159Stheraven using aligned_union_t = typename aligned_union<Len,Types...>::type; // C++14 185253159Stheraven template <class T> 186253159Stheraven using decay_t = typename decay<T>::type; // C++14 187253159Stheraven template <bool b, class T=void> 188253159Stheraven using enable_if_t = typename enable_if<b,T>::type; // C++14 189253159Stheraven template <bool b, class T, class F> 190253159Stheraven using conditional_t = typename conditional<b,T,F>::type; // C++14 191253159Stheraven template <class... T> 192253159Stheraven using common_type_t = typename common_type<T...>::type; // C++14 193253159Stheraven template <class T> 194253159Stheraven using underlying_type_t = typename underlying_type<T>::type; // C++14 195253159Stheraven template <class F, class... ArgTypes> 196253159Stheraven using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14 197253159Stheraven 198227825Stheraven} // std 199227825Stheraven 200227825Stheraven*/ 201227825Stheraven#include <__config> 202227825Stheraven#include <cstddef> 203227825Stheraven 204227825Stheraven#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 205227825Stheraven#pragma GCC system_header 206227825Stheraven#endif 207227825Stheraven 208227825Stheraven_LIBCPP_BEGIN_NAMESPACE_STD 209227825Stheraven 210232950Stheraventemplate <bool _Bp, class _If, class _Then> 211249998Sdim struct _LIBCPP_TYPE_VIS conditional {typedef _If type;}; 212227825Stheraventemplate <class _If, class _Then> 213249998Sdim struct _LIBCPP_TYPE_VIS conditional<false, _If, _Then> {typedef _Then type;}; 214227825Stheraven 215253159Stheraven#if _LIBCPP_STD_VER > 11 216253159Stheraventemplate <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type; 217253159Stheraven#endif 218253159Stheraven 219249998Sdimtemplate <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS enable_if {}; 220249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS enable_if<true, _Tp> {typedef _Tp type;}; 221227825Stheraven 222253159Stheraven#if _LIBCPP_STD_VER > 11 223253159Stheraventemplate <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type; 224253159Stheraven#endif 225253159Stheraven 226253159Stheraven 227242945Stheravenstruct __two {char __lx[2];}; 228227825Stheraven 229227825Stheraven// helper class: 230227825Stheraven 231227825Stheraventemplate <class _Tp, _Tp __v> 232249998Sdimstruct _LIBCPP_TYPE_VIS integral_constant 233227825Stheraven{ 234234976Stheraven static _LIBCPP_CONSTEXPR const _Tp value = __v; 235227825Stheraven typedef _Tp value_type; 236227825Stheraven typedef integral_constant type; 237227825Stheraven _LIBCPP_INLINE_VISIBILITY 238234976Stheraven _LIBCPP_CONSTEXPR operator value_type() const {return value;} 239227825Stheraven}; 240227825Stheraven 241227825Stheraventemplate <class _Tp, _Tp __v> 242234976Stheraven_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value; 243227825Stheraven 244227825Stheraventypedef integral_constant<bool, true> true_type; 245227825Stheraventypedef integral_constant<bool, false> false_type; 246227825Stheraven 247227825Stheraven// is_const 248227825Stheraven 249249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_const : public false_type {}; 250249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_const<_Tp const> : public true_type {}; 251227825Stheraven 252227825Stheraven// is_volatile 253227825Stheraven 254249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_volatile : public false_type {}; 255249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_volatile<_Tp volatile> : public true_type {}; 256227825Stheraven 257227825Stheraven// remove_const 258227825Stheraven 259249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_const {typedef _Tp type;}; 260249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_const<const _Tp> {typedef _Tp type;}; 261253159Stheraven#if _LIBCPP_STD_VER > 11 262253159Stheraventemplate <class _Tp> using remove_const_t = typename remove_const<_Tp>::type; 263253159Stheraven#endif 264227825Stheraven 265227825Stheraven// remove_volatile 266227825Stheraven 267249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_volatile {typedef _Tp type;}; 268249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;}; 269253159Stheraven#if _LIBCPP_STD_VER > 11 270253159Stheraventemplate <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type; 271253159Stheraven#endif 272227825Stheraven 273227825Stheraven// remove_cv 274227825Stheraven 275249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_cv 276227825Stheraven{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;}; 277253159Stheraven#if _LIBCPP_STD_VER > 11 278253159Stheraventemplate <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type; 279253159Stheraven#endif 280227825Stheraven 281227825Stheraven// is_void 282227825Stheraven 283260015Sdimtemplate <class _Tp> struct __libcpp_is_void : public false_type {}; 284260015Sdimtemplate <> struct __libcpp_is_void<void> : public true_type {}; 285227825Stheraven 286249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_void 287260015Sdim : public __libcpp_is_void<typename remove_cv<_Tp>::type> {}; 288227825Stheraven 289227825Stheraven// __is_nullptr_t 290227825Stheraven 291260015Sdimtemplate <class _Tp> struct __libcpp___is_nullptr : public false_type {}; 292260015Sdimtemplate <> struct __libcpp___is_nullptr<nullptr_t> : public true_type {}; 293227825Stheraven 294249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS __is_nullptr_t 295260015Sdim : public __libcpp___is_nullptr<typename remove_cv<_Tp>::type> {}; 296227825Stheraven 297227825Stheraven// is_integral 298227825Stheraven 299260015Sdimtemplate <class _Tp> struct __libcpp_is_integral : public false_type {}; 300260015Sdimtemplate <> struct __libcpp_is_integral<bool> : public true_type {}; 301260015Sdimtemplate <> struct __libcpp_is_integral<char> : public true_type {}; 302260015Sdimtemplate <> struct __libcpp_is_integral<signed char> : public true_type {}; 303260015Sdimtemplate <> struct __libcpp_is_integral<unsigned char> : public true_type {}; 304260015Sdimtemplate <> struct __libcpp_is_integral<wchar_t> : public true_type {}; 305227825Stheraven#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS 306260015Sdimtemplate <> struct __libcpp_is_integral<char16_t> : public true_type {}; 307260015Sdimtemplate <> struct __libcpp_is_integral<char32_t> : public true_type {}; 308227825Stheraven#endif // _LIBCPP_HAS_NO_UNICODE_CHARS 309260015Sdimtemplate <> struct __libcpp_is_integral<short> : public true_type {}; 310260015Sdimtemplate <> struct __libcpp_is_integral<unsigned short> : public true_type {}; 311260015Sdimtemplate <> struct __libcpp_is_integral<int> : public true_type {}; 312260015Sdimtemplate <> struct __libcpp_is_integral<unsigned int> : public true_type {}; 313260015Sdimtemplate <> struct __libcpp_is_integral<long> : public true_type {}; 314260015Sdimtemplate <> struct __libcpp_is_integral<unsigned long> : public true_type {}; 315260015Sdimtemplate <> struct __libcpp_is_integral<long long> : public true_type {}; 316260015Sdimtemplate <> struct __libcpp_is_integral<unsigned long long> : public true_type {}; 317227825Stheraven 318249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_integral 319260015Sdim : public __libcpp_is_integral<typename remove_cv<_Tp>::type> {}; 320227825Stheraven 321227825Stheraven// is_floating_point 322227825Stheraven 323260015Sdimtemplate <class _Tp> struct __libcpp_is_floating_point : public false_type {}; 324260015Sdimtemplate <> struct __libcpp_is_floating_point<float> : public true_type {}; 325260015Sdimtemplate <> struct __libcpp_is_floating_point<double> : public true_type {}; 326260015Sdimtemplate <> struct __libcpp_is_floating_point<long double> : public true_type {}; 327227825Stheraven 328249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_floating_point 329260015Sdim : public __libcpp_is_floating_point<typename remove_cv<_Tp>::type> {}; 330227825Stheraven 331227825Stheraven// is_array 332227825Stheraven 333249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_array 334227825Stheraven : public false_type {}; 335249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_array<_Tp[]> 336227825Stheraven : public true_type {}; 337249998Sdimtemplate <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS is_array<_Tp[_Np]> 338227825Stheraven : public true_type {}; 339227825Stheraven 340227825Stheraven// is_pointer 341227825Stheraven 342260015Sdimtemplate <class _Tp> struct __libcpp_is_pointer : public false_type {}; 343260015Sdimtemplate <class _Tp> struct __libcpp_is_pointer<_Tp*> : public true_type {}; 344227825Stheraven 345249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_pointer 346260015Sdim : public __libcpp_is_pointer<typename remove_cv<_Tp>::type> {}; 347227825Stheraven 348227825Stheraven// is_reference 349227825Stheraven 350249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_lvalue_reference : public false_type {}; 351249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_lvalue_reference<_Tp&> : public true_type {}; 352227825Stheraven 353249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_rvalue_reference : public false_type {}; 354227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 355249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_rvalue_reference<_Tp&&> : public true_type {}; 356227825Stheraven#endif 357227825Stheraven 358249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_reference : public false_type {}; 359249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_reference<_Tp&> : public true_type {}; 360227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 361249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_reference<_Tp&&> : public true_type {}; 362227825Stheraven#endif 363227825Stheraven 364227825Stheraven#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 365227825Stheraven#define _LIBCPP_HAS_TYPE_TRAITS 366227825Stheraven#endif 367227825Stheraven 368227825Stheraven// is_union 369227825Stheraven 370227825Stheraven#if __has_feature(is_union) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 371227825Stheraven 372249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_union 373227825Stheraven : public integral_constant<bool, __is_union(_Tp)> {}; 374227825Stheraven 375227825Stheraven#else 376227825Stheraven 377227825Stheraventemplate <class _Tp> struct __libcpp_union : public false_type {}; 378249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_union 379227825Stheraven : public __libcpp_union<typename remove_cv<_Tp>::type> {}; 380227825Stheraven 381227825Stheraven#endif 382227825Stheraven 383227825Stheraven// is_class 384227825Stheraven 385227825Stheraven#if __has_feature(is_class) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 386227825Stheraven 387249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_class 388227825Stheraven : public integral_constant<bool, __is_class(_Tp)> {}; 389227825Stheraven 390227825Stheraven#else 391227825Stheraven 392227825Stheravennamespace __is_class_imp 393227825Stheraven{ 394227825Stheraventemplate <class _Tp> char __test(int _Tp::*); 395227825Stheraventemplate <class _Tp> __two __test(...); 396227825Stheraven} 397227825Stheraven 398249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_class 399227825Stheraven : public integral_constant<bool, sizeof(__is_class_imp::__test<_Tp>(0)) == 1 && !is_union<_Tp>::value> {}; 400227825Stheraven 401227825Stheraven#endif 402227825Stheraven 403227825Stheraven// is_same 404227825Stheraven 405249998Sdimtemplate <class _Tp, class _Up> struct _LIBCPP_TYPE_VIS is_same : public false_type {}; 406249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_same<_Tp, _Tp> : public true_type {}; 407227825Stheraven 408227825Stheraven// is_function 409227825Stheraven 410227825Stheravennamespace __is_function_imp 411227825Stheraven{ 412227825Stheraventemplate <class _Tp> char __test(_Tp*); 413227825Stheraventemplate <class _Tp> __two __test(...); 414227825Stheraventemplate <class _Tp> _Tp& __source(); 415227825Stheraven} 416227825Stheraven 417227825Stheraventemplate <class _Tp, bool = is_class<_Tp>::value || 418227825Stheraven is_union<_Tp>::value || 419227825Stheraven is_void<_Tp>::value || 420227825Stheraven is_reference<_Tp>::value || 421227825Stheraven is_same<_Tp, nullptr_t>::value > 422260015Sdimstruct __libcpp_is_function 423227825Stheraven : public integral_constant<bool, sizeof(__is_function_imp::__test<_Tp>(__is_function_imp::__source<_Tp>())) == 1> 424227825Stheraven {}; 425260015Sdimtemplate <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type {}; 426227825Stheraven 427249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_function 428260015Sdim : public __libcpp_is_function<_Tp> {}; 429227825Stheraven 430227825Stheraven// is_member_function_pointer 431227825Stheraven 432260015Sdimtemplate <class _Tp> struct __libcpp_is_member_function_pointer : public false_type {}; 433260015Sdimtemplate <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {}; 434227825Stheraven 435249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_member_function_pointer 436260015Sdim : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {}; 437227825Stheraven 438227825Stheraven// is_member_pointer 439227825Stheraven 440260015Sdimtemplate <class _Tp> struct __libcpp_is_member_pointer : public false_type {}; 441260015Sdimtemplate <class _Tp, class _Up> struct __libcpp_is_member_pointer<_Tp _Up::*> : public true_type {}; 442227825Stheraven 443249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_member_pointer 444260015Sdim : public __libcpp_is_member_pointer<typename remove_cv<_Tp>::type> {}; 445227825Stheraven 446227825Stheraven// is_member_object_pointer 447227825Stheraven 448249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_member_object_pointer 449227825Stheraven : public integral_constant<bool, is_member_pointer<_Tp>::value && 450227825Stheraven !is_member_function_pointer<_Tp>::value> {}; 451227825Stheraven 452227825Stheraven// is_enum 453227825Stheraven 454227825Stheraven#if __has_feature(is_enum) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 455227825Stheraven 456249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_enum 457227825Stheraven : public integral_constant<bool, __is_enum(_Tp)> {}; 458227825Stheraven 459227825Stheraven#else 460227825Stheraven 461249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_enum 462227825Stheraven : public integral_constant<bool, !is_void<_Tp>::value && 463227825Stheraven !is_integral<_Tp>::value && 464227825Stheraven !is_floating_point<_Tp>::value && 465227825Stheraven !is_array<_Tp>::value && 466227825Stheraven !is_pointer<_Tp>::value && 467227825Stheraven !is_reference<_Tp>::value && 468227825Stheraven !is_member_pointer<_Tp>::value && 469227825Stheraven !is_union<_Tp>::value && 470227825Stheraven !is_class<_Tp>::value && 471227825Stheraven !is_function<_Tp>::value > {}; 472227825Stheraven 473227825Stheraven#endif 474227825Stheraven 475227825Stheraven// is_arithmetic 476227825Stheraven 477249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_arithmetic 478227825Stheraven : public integral_constant<bool, is_integral<_Tp>::value || 479227825Stheraven is_floating_point<_Tp>::value> {}; 480227825Stheraven 481227825Stheraven// is_fundamental 482227825Stheraven 483249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_fundamental 484227825Stheraven : public integral_constant<bool, is_void<_Tp>::value || 485227825Stheraven __is_nullptr_t<_Tp>::value || 486227825Stheraven is_arithmetic<_Tp>::value> {}; 487227825Stheraven 488227825Stheraven// is_scalar 489227825Stheraven 490249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_scalar 491227825Stheraven : public integral_constant<bool, is_arithmetic<_Tp>::value || 492227825Stheraven is_member_pointer<_Tp>::value || 493227825Stheraven is_pointer<_Tp>::value || 494227825Stheraven __is_nullptr_t<_Tp>::value || 495227825Stheraven is_enum<_Tp>::value > {}; 496227825Stheraven 497249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS is_scalar<nullptr_t> : public true_type {}; 498227825Stheraven 499227825Stheraven// is_object 500227825Stheraven 501249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_object 502227825Stheraven : public integral_constant<bool, is_scalar<_Tp>::value || 503227825Stheraven is_array<_Tp>::value || 504227825Stheraven is_union<_Tp>::value || 505227825Stheraven is_class<_Tp>::value > {}; 506227825Stheraven 507227825Stheraven// is_compound 508227825Stheraven 509249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_compound 510227825Stheraven : public integral_constant<bool, !is_fundamental<_Tp>::value> {}; 511227825Stheraven 512227825Stheraven// add_const 513227825Stheraven 514227825Stheraventemplate <class _Tp, bool = is_reference<_Tp>::value || 515227825Stheraven is_function<_Tp>::value || 516227825Stheraven is_const<_Tp>::value > 517227825Stheravenstruct __add_const {typedef _Tp type;}; 518227825Stheraven 519227825Stheraventemplate <class _Tp> 520227825Stheravenstruct __add_const<_Tp, false> {typedef const _Tp type;}; 521227825Stheraven 522249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS add_const 523227825Stheraven {typedef typename __add_const<_Tp>::type type;}; 524227825Stheraven 525253159Stheraven#if _LIBCPP_STD_VER > 11 526253159Stheraventemplate <class _Tp> using add_const_t = typename add_const<_Tp>::type; 527253159Stheraven#endif 528253159Stheraven 529227825Stheraven// add_volatile 530227825Stheraven 531227825Stheraventemplate <class _Tp, bool = is_reference<_Tp>::value || 532227825Stheraven is_function<_Tp>::value || 533227825Stheraven is_volatile<_Tp>::value > 534227825Stheravenstruct __add_volatile {typedef _Tp type;}; 535227825Stheraven 536227825Stheraventemplate <class _Tp> 537227825Stheravenstruct __add_volatile<_Tp, false> {typedef volatile _Tp type;}; 538227825Stheraven 539249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS add_volatile 540227825Stheraven {typedef typename __add_volatile<_Tp>::type type;}; 541227825Stheraven 542253159Stheraven#if _LIBCPP_STD_VER > 11 543253159Stheraventemplate <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type; 544253159Stheraven#endif 545253159Stheraven 546227825Stheraven// add_cv 547227825Stheraven 548249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS add_cv 549227825Stheraven {typedef typename add_const<typename add_volatile<_Tp>::type>::type type;}; 550227825Stheraven 551253159Stheraven#if _LIBCPP_STD_VER > 11 552253159Stheraventemplate <class _Tp> using add_cv_t = typename add_cv<_Tp>::type; 553253159Stheraven#endif 554253159Stheraven 555227825Stheraven// remove_reference 556227825Stheraven 557249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_reference {typedef _Tp type;}; 558249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_reference<_Tp&> {typedef _Tp type;}; 559227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 560249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_reference<_Tp&&> {typedef _Tp type;}; 561227825Stheraven#endif 562227825Stheraven 563253159Stheraven#if _LIBCPP_STD_VER > 11 564253159Stheraventemplate <class _Tp> using remove_reference_t = typename remove_reference<_Tp>::type; 565253159Stheraven#endif 566253159Stheraven 567227825Stheraven// add_lvalue_reference 568227825Stheraven 569249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS add_lvalue_reference {typedef _Tp& type;}; 570249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS add_lvalue_reference<_Tp&> {typedef _Tp& type;}; // for older compiler 571249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<void> {typedef void type;}; 572249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<const void> {typedef const void type;}; 573249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<volatile void> {typedef volatile void type;}; 574249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<const volatile void> {typedef const volatile void type;}; 575227825Stheraven 576253159Stheraven#if _LIBCPP_STD_VER > 11 577253159Stheraventemplate <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; 578253159Stheraven#endif 579253159Stheraven 580227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 581227825Stheraven 582249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS add_rvalue_reference {typedef _Tp&& type;}; 583249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<void> {typedef void type;}; 584249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<const void> {typedef const void type;}; 585249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<volatile void> {typedef volatile void type;}; 586249998Sdimtemplate <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<const volatile void> {typedef const volatile void type;}; 587227825Stheraven 588253159Stheraven#if _LIBCPP_STD_VER > 11 589253159Stheraventemplate <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; 590253159Stheraven#endif 591253159Stheraven 592227825Stheraven#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 593227825Stheraven 594227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 595227825Stheraven 596227825Stheraventemplate <class _Tp> 597227825Stheraventypename add_rvalue_reference<_Tp>::type 598227825Stheravendeclval() _NOEXCEPT; 599227825Stheraven 600227825Stheraven#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES 601227825Stheraven 602227825Stheraventemplate <class _Tp> 603227825Stheraventypename add_lvalue_reference<_Tp>::type 604227825Stheravendeclval(); 605227825Stheraven 606227825Stheraven#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 607227825Stheraven 608227825Stheravenstruct __any 609227825Stheraven{ 610227825Stheraven __any(...); 611227825Stheraven}; 612227825Stheraven 613227825Stheraven// remove_pointer 614227825Stheraven 615249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer {typedef _Tp type;}; 616249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp*> {typedef _Tp type;}; 617249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* const> {typedef _Tp type;}; 618249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* volatile> {typedef _Tp type;}; 619249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* const volatile> {typedef _Tp type;}; 620227825Stheraven 621253159Stheraven#if _LIBCPP_STD_VER > 11 622253159Stheraventemplate <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type; 623253159Stheraven#endif 624253159Stheraven 625227825Stheraven// add_pointer 626227825Stheraven 627249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS add_pointer 628227825Stheraven {typedef typename remove_reference<_Tp>::type* type;}; 629227825Stheraven 630253159Stheraven#if _LIBCPP_STD_VER > 11 631253159Stheraventemplate <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type; 632253159Stheraven#endif 633253159Stheraven 634227825Stheraven// is_signed 635227825Stheraven 636227825Stheraventemplate <class _Tp, bool = is_integral<_Tp>::value> 637227825Stheravenstruct ___is_signed : public integral_constant<bool, _Tp(-1) < _Tp(0)> {}; 638227825Stheraven 639227825Stheraventemplate <class _Tp> 640227825Stheravenstruct ___is_signed<_Tp, false> : public true_type {}; // floating point 641227825Stheraven 642227825Stheraventemplate <class _Tp, bool = is_arithmetic<_Tp>::value> 643260015Sdimstruct __libcpp_is_signed : public ___is_signed<_Tp> {}; 644227825Stheraven 645260015Sdimtemplate <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {}; 646227825Stheraven 647260015Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_signed : public __libcpp_is_signed<_Tp> {}; 648227825Stheraven 649227825Stheraven// is_unsigned 650227825Stheraven 651227825Stheraventemplate <class _Tp, bool = is_integral<_Tp>::value> 652227825Stheravenstruct ___is_unsigned : public integral_constant<bool, _Tp(0) < _Tp(-1)> {}; 653227825Stheraven 654227825Stheraventemplate <class _Tp> 655227825Stheravenstruct ___is_unsigned<_Tp, false> : public false_type {}; // floating point 656227825Stheraven 657227825Stheraventemplate <class _Tp, bool = is_arithmetic<_Tp>::value> 658260015Sdimstruct __libcpp_is_unsigned : public ___is_unsigned<_Tp> {}; 659227825Stheraven 660260015Sdimtemplate <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {}; 661227825Stheraven 662260015Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_unsigned : public __libcpp_is_unsigned<_Tp> {}; 663227825Stheraven 664227825Stheraven// rank 665227825Stheraven 666249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS rank 667227825Stheraven : public integral_constant<size_t, 0> {}; 668249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS rank<_Tp[]> 669227825Stheraven : public integral_constant<size_t, rank<_Tp>::value + 1> {}; 670249998Sdimtemplate <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS rank<_Tp[_Np]> 671227825Stheraven : public integral_constant<size_t, rank<_Tp>::value + 1> {}; 672227825Stheraven 673227825Stheraven// extent 674227825Stheraven 675249998Sdimtemplate <class _Tp, unsigned _Ip = 0> struct _LIBCPP_TYPE_VIS extent 676227825Stheraven : public integral_constant<size_t, 0> {}; 677249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS extent<_Tp[], 0> 678227825Stheraven : public integral_constant<size_t, 0> {}; 679249998Sdimtemplate <class _Tp, unsigned _Ip> struct _LIBCPP_TYPE_VIS extent<_Tp[], _Ip> 680227825Stheraven : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {}; 681249998Sdimtemplate <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS extent<_Tp[_Np], 0> 682227825Stheraven : public integral_constant<size_t, _Np> {}; 683249998Sdimtemplate <class _Tp, size_t _Np, unsigned _Ip> struct _LIBCPP_TYPE_VIS extent<_Tp[_Np], _Ip> 684227825Stheraven : public integral_constant<size_t, extent<_Tp, _Ip-1>::value> {}; 685227825Stheraven 686227825Stheraven// remove_extent 687227825Stheraven 688249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_extent 689227825Stheraven {typedef _Tp type;}; 690249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_extent<_Tp[]> 691227825Stheraven {typedef _Tp type;}; 692249998Sdimtemplate <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS remove_extent<_Tp[_Np]> 693227825Stheraven {typedef _Tp type;}; 694227825Stheraven 695253159Stheraven#if _LIBCPP_STD_VER > 11 696253159Stheraventemplate <class _Tp> using remove_extent_t = typename remove_extent<_Tp>::type; 697253159Stheraven#endif 698253159Stheraven 699227825Stheraven// remove_all_extents 700227825Stheraven 701249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_all_extents 702227825Stheraven {typedef _Tp type;}; 703249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS remove_all_extents<_Tp[]> 704227825Stheraven {typedef typename remove_all_extents<_Tp>::type type;}; 705249998Sdimtemplate <class _Tp, size_t _Np> struct _LIBCPP_TYPE_VIS remove_all_extents<_Tp[_Np]> 706227825Stheraven {typedef typename remove_all_extents<_Tp>::type type;}; 707227825Stheraven 708253159Stheraven#if _LIBCPP_STD_VER > 11 709253159Stheraventemplate <class _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type; 710253159Stheraven#endif 711253159Stheraven 712227825Stheraven// is_abstract 713227825Stheraven 714227825Stheravennamespace __is_abstract_imp 715227825Stheraven{ 716227825Stheraventemplate <class _Tp> char __test(_Tp (*)[1]); 717227825Stheraventemplate <class _Tp> __two __test(...); 718227825Stheraven} 719227825Stheraven 720227825Stheraventemplate <class _Tp, bool = is_class<_Tp>::value> 721227825Stheravenstruct __libcpp_abstract : public integral_constant<bool, sizeof(__is_abstract_imp::__test<_Tp>(0)) != 1> {}; 722227825Stheraven 723227825Stheraventemplate <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {}; 724227825Stheraven 725249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_abstract : public __libcpp_abstract<_Tp> {}; 726227825Stheraven 727241903Sdim// is_base_of 728241903Sdim 729241903Sdim#ifdef _LIBCP_HAS_IS_BASE_OF 730241903Sdim 731241903Sdimtemplate <class _Bp, class _Dp> 732249998Sdimstruct _LIBCPP_TYPE_VIS is_base_of 733241903Sdim : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {}; 734241903Sdim 735241903Sdim#else // __has_feature(is_base_of) 736241903Sdim 737246487Stheravennamespace __is_base_of_imp 738246487Stheraven{ 739246487Stheraventemplate <class _Tp> 740246487Stheravenstruct _Dst 741246487Stheraven{ 742246487Stheraven _Dst(const volatile _Tp &); 743246487Stheraven}; 744246487Stheraventemplate <class _Tp> 745246487Stheravenstruct _Src 746246487Stheraven{ 747246487Stheraven operator const volatile _Tp &(); 748246487Stheraven template <class _Up> operator const _Dst<_Up> &(); 749246487Stheraven}; 750246487Stheraventemplate <size_t> struct __one { typedef char type; }; 751246487Stheraventemplate <class _Bp, class _Dp> typename __one<sizeof(_Dst<_Bp>(declval<_Src<_Dp> >()))>::type __test(int); 752246487Stheraventemplate <class _Bp, class _Dp> __two __test(...); 753246487Stheraven} 754241903Sdim 755246487Stheraventemplate <class _Bp, class _Dp> 756249998Sdimstruct _LIBCPP_TYPE_VIS is_base_of 757246487Stheraven : public integral_constant<bool, is_class<_Bp>::value && 758246487Stheraven sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {}; 759246487Stheraven 760241903Sdim#endif // __has_feature(is_base_of) 761241903Sdim 762227825Stheraven// is_convertible 763227825Stheraven 764227825Stheraven#if __has_feature(is_convertible_to) 765227825Stheraven 766249998Sdimtemplate <class _T1, class _T2> struct _LIBCPP_TYPE_VIS is_convertible 767241903Sdim : public integral_constant<bool, __is_convertible_to(_T1, _T2) && 768241903Sdim !is_abstract<_T2>::value> {}; 769227825Stheraven 770227825Stheraven#else // __has_feature(is_convertible_to) 771227825Stheraven 772227825Stheravennamespace __is_convertible_imp 773227825Stheraven{ 774227825Stheraventemplate <class _Tp> char __test(_Tp); 775227825Stheraventemplate <class _Tp> __two __test(...); 776227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 777227825Stheraventemplate <class _Tp> _Tp&& __source(); 778227825Stheraven#else 779227825Stheraventemplate <class _Tp> typename remove_reference<_Tp>::type& __source(); 780227825Stheraven#endif 781227825Stheraven 782227825Stheraventemplate <class _Tp, bool _IsArray = is_array<_Tp>::value, 783227825Stheraven bool _IsFunction = is_function<_Tp>::value, 784227825Stheraven bool _IsVoid = is_void<_Tp>::value> 785227825Stheraven struct __is_array_function_or_void {enum {value = 0};}; 786227825Stheraventemplate <class _Tp> struct __is_array_function_or_void<_Tp, true, false, false> {enum {value = 1};}; 787227825Stheraventemplate <class _Tp> struct __is_array_function_or_void<_Tp, false, true, false> {enum {value = 2};}; 788227825Stheraventemplate <class _Tp> struct __is_array_function_or_void<_Tp, false, false, true> {enum {value = 3};}; 789227825Stheraven} 790227825Stheraven 791227825Stheraventemplate <class _Tp, 792227825Stheraven unsigned = __is_convertible_imp::__is_array_function_or_void<typename remove_reference<_Tp>::type>::value> 793227825Stheravenstruct __is_convertible_check 794227825Stheraven{ 795227825Stheraven static const size_t __v = 0; 796227825Stheraven}; 797227825Stheraven 798227825Stheraventemplate <class _Tp> 799227825Stheravenstruct __is_convertible_check<_Tp, 0> 800227825Stheraven{ 801227825Stheraven static const size_t __v = sizeof(_Tp); 802227825Stheraven}; 803227825Stheraven 804227825Stheraventemplate <class _T1, class _T2, 805227825Stheraven unsigned _T1_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T1>::value, 806227825Stheraven unsigned _T2_is_array_function_or_void = __is_convertible_imp::__is_array_function_or_void<_T2>::value> 807227825Stheravenstruct __is_convertible 808227825Stheraven : public integral_constant<bool, 809241903Sdim#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 810227825Stheraven sizeof(__is_convertible_imp::__test<_T2>(__is_convertible_imp::__source<_T1>())) == 1 811241903Sdim#else 812241903Sdim sizeof(__is_convertible_imp::__test<_T2>(__is_convertible_imp::__source<_T1>())) == 1 813241903Sdim && !(!is_function<_T1>::value && !is_reference<_T1>::value && is_reference<_T2>::value 814241903Sdim && (!is_const<typename remove_reference<_T2>::type>::value 815241903Sdim || is_volatile<typename remove_reference<_T2>::type>::value) 816241903Sdim && (is_same<typename remove_cv<_T1>::type, 817241903Sdim typename remove_cv<typename remove_reference<_T2>::type>::type>::value 818241903Sdim || is_base_of<typename remove_reference<_T2>::type, _T1>::value)) 819241903Sdim#endif 820227825Stheraven > 821227825Stheraven{}; 822227825Stheraven 823227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 0> : false_type {}; 824227825Stheraven 825227825Stheraventemplate <class _T1> struct __is_convertible<_T1, const _T1&, 1, 0> : true_type {}; 826227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 827227825Stheraventemplate <class _T1> struct __is_convertible<_T1, _T1&&, 1, 0> : true_type {}; 828227825Stheraventemplate <class _T1> struct __is_convertible<_T1, const _T1&&, 1, 0> : true_type {}; 829227825Stheraventemplate <class _T1> struct __is_convertible<_T1, volatile _T1&&, 1, 0> : true_type {}; 830227825Stheraventemplate <class _T1> struct __is_convertible<_T1, const volatile _T1&&, 1, 0> : true_type {}; 831227825Stheraven#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 832227825Stheraven 833227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2*, 1, 0> 834227825Stheraven : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*>::value> {}; 835227825Stheraven 836227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2* const, 1, 0> 837227825Stheraven : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*const>::value> {}; 838227825Stheraven 839227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2* volatile, 1, 0> 840227825Stheraven : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*volatile>::value> {}; 841227825Stheraven 842227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2* const volatile, 1, 0> 843227825Stheraven : public integral_constant<bool, __is_convertible<typename remove_all_extents<_T1>::type*, _T2*const volatile>::value> {}; 844227825Stheraven 845227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 0> : public false_type {}; 846227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 847227825Stheraventemplate <class _T1> struct __is_convertible<_T1, _T1&&, 2, 0> : public true_type {}; 848227825Stheraven#endif 849241903Sdimtemplate <class _T1> struct __is_convertible<_T1, _T1&, 2, 0> : public true_type {}; 850227825Stheraventemplate <class _T1> struct __is_convertible<_T1, _T1*, 2, 0> : public true_type {}; 851227825Stheraventemplate <class _T1> struct __is_convertible<_T1, _T1*const, 2, 0> : public true_type {}; 852227825Stheraventemplate <class _T1> struct __is_convertible<_T1, _T1*volatile, 2, 0> : public true_type {}; 853227825Stheraventemplate <class _T1> struct __is_convertible<_T1, _T1*const volatile, 2, 0> : public true_type {}; 854227825Stheraven 855227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 0> : public false_type {}; 856227825Stheraven 857227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 1> : public false_type {}; 858227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 1> : public false_type {}; 859227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 1> : public false_type {}; 860227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 1> : public false_type {}; 861227825Stheraven 862227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 2> : public false_type {}; 863227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 2> : public false_type {}; 864227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 2> : public false_type {}; 865227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 2> : public false_type {}; 866227825Stheraven 867227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 0, 3> : public false_type {}; 868227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 1, 3> : public false_type {}; 869227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 2, 3> : public false_type {}; 870227825Stheraventemplate <class _T1, class _T2> struct __is_convertible<_T1, _T2, 3, 3> : public true_type {}; 871227825Stheraven 872249998Sdimtemplate <class _T1, class _T2> struct _LIBCPP_TYPE_VIS is_convertible 873227825Stheraven : public __is_convertible<_T1, _T2> 874227825Stheraven{ 875227825Stheraven static const size_t __complete_check1 = __is_convertible_check<_T1>::__v; 876227825Stheraven static const size_t __complete_check2 = __is_convertible_check<_T2>::__v; 877227825Stheraven}; 878227825Stheraven 879227825Stheraven#endif // __has_feature(is_convertible_to) 880227825Stheraven 881227825Stheraven// is_empty 882227825Stheraven 883232950Stheraven#if __has_feature(is_empty) 884232950Stheraven 885227825Stheraventemplate <class _Tp> 886249998Sdimstruct _LIBCPP_TYPE_VIS is_empty 887232950Stheraven : public integral_constant<bool, __is_empty(_Tp)> {}; 888232950Stheraven 889232950Stheraven#else // __has_feature(is_empty) 890232950Stheraven 891232950Stheraventemplate <class _Tp> 892227825Stheravenstruct __is_empty1 893227825Stheraven : public _Tp 894227825Stheraven{ 895242945Stheraven double __lx; 896227825Stheraven}; 897227825Stheraven 898227825Stheravenstruct __is_empty2 899227825Stheraven{ 900242945Stheraven double __lx; 901227825Stheraven}; 902227825Stheraven 903227825Stheraventemplate <class _Tp, bool = is_class<_Tp>::value> 904227825Stheravenstruct __libcpp_empty : public integral_constant<bool, sizeof(__is_empty1<_Tp>) == sizeof(__is_empty2)> {}; 905227825Stheraven 906227825Stheraventemplate <class _Tp> struct __libcpp_empty<_Tp, false> : public false_type {}; 907227825Stheraven 908249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_empty : public __libcpp_empty<_Tp> {}; 909227825Stheraven 910232950Stheraven#endif // __has_feature(is_empty) 911232950Stheraven 912227825Stheraven// is_polymorphic 913227825Stheraven 914232950Stheraven#if __has_feature(is_polymorphic) 915232950Stheraven 916232950Stheraventemplate <class _Tp> 917249998Sdimstruct _LIBCPP_TYPE_VIS is_polymorphic 918232950Stheraven : public integral_constant<bool, __is_polymorphic(_Tp)> {}; 919232950Stheraven 920232950Stheraven#else 921232950Stheraven 922249998Sdimtemplate<typename _Tp> char &__is_polymorphic_impl( 923249998Sdim typename enable_if<sizeof((_Tp*)dynamic_cast<const volatile void*>(declval<_Tp*>())) != 0, 924249998Sdim int>::type); 925249998Sdimtemplate<typename _Tp> __two &__is_polymorphic_impl(...); 926227825Stheraven 927249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_polymorphic 928249998Sdim : public integral_constant<bool, sizeof(__is_polymorphic_impl<_Tp>(0)) == 1> {}; 929227825Stheraven 930232950Stheraven#endif // __has_feature(is_polymorphic) 931232950Stheraven 932227825Stheraven// has_virtual_destructor 933227825Stheraven 934227825Stheraven#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 935227825Stheraven 936249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS has_virtual_destructor 937227825Stheraven : public integral_constant<bool, __has_virtual_destructor(_Tp)> {}; 938227825Stheraven 939227825Stheraven#else // _LIBCPP_HAS_TYPE_TRAITS 940227825Stheraven 941249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS has_virtual_destructor 942227825Stheraven : public false_type {}; 943227825Stheraven 944227825Stheraven#endif // _LIBCPP_HAS_TYPE_TRAITS 945227825Stheraven 946227825Stheraven// alignment_of 947227825Stheraven 948249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS alignment_of 949249998Sdim : public integral_constant<size_t, __alignof__(_Tp)> {}; 950227825Stheraven 951227825Stheraven// aligned_storage 952227825Stheraven 953227825Stheraventemplate <class _Hp, class _Tp> 954227825Stheravenstruct __type_list 955227825Stheraven{ 956227825Stheraven typedef _Hp _Head; 957227825Stheraven typedef _Tp _Tail; 958227825Stheraven}; 959227825Stheraven 960227825Stheravenstruct __nat 961227825Stheraven{ 962227825Stheraven#ifndef _LIBCPP_HAS_NO_DELETED_FUNCTIONS 963227825Stheraven __nat() = delete; 964227825Stheraven __nat(const __nat&) = delete; 965227825Stheraven __nat& operator=(const __nat&) = delete; 966227825Stheraven ~__nat() = delete; 967227825Stheraven#endif 968227825Stheraven}; 969227825Stheraven 970227825Stheraventemplate <class _Tp> 971227825Stheravenstruct __align_type 972227825Stheraven{ 973227825Stheraven static const size_t value = alignment_of<_Tp>::value; 974227825Stheraven typedef _Tp type; 975227825Stheraven}; 976227825Stheraven 977242945Stheravenstruct __struct_double {long double __lx;}; 978242945Stheravenstruct __struct_double4 {double __lx[4];}; 979227825Stheraven 980227825Stheraventypedef 981227825Stheraven __type_list<__align_type<unsigned char>, 982227825Stheraven __type_list<__align_type<unsigned short>, 983227825Stheraven __type_list<__align_type<unsigned int>, 984227825Stheraven __type_list<__align_type<unsigned long>, 985227825Stheraven __type_list<__align_type<unsigned long long>, 986227825Stheraven __type_list<__align_type<double>, 987227825Stheraven __type_list<__align_type<long double>, 988227825Stheraven __type_list<__align_type<__struct_double>, 989227825Stheraven __type_list<__align_type<__struct_double4>, 990227825Stheraven __type_list<__align_type<int*>, 991227825Stheraven __nat 992227825Stheraven > > > > > > > > > > __all_types; 993227825Stheraven 994227825Stheraventemplate <class _TL, size_t _Align> struct __find_pod; 995227825Stheraven 996227825Stheraventemplate <class _Hp, size_t _Align> 997227825Stheravenstruct __find_pod<__type_list<_Hp, __nat>, _Align> 998227825Stheraven{ 999227825Stheraven typedef typename conditional< 1000227825Stheraven _Align == _Hp::value, 1001227825Stheraven typename _Hp::type, 1002227825Stheraven void 1003227825Stheraven >::type type; 1004227825Stheraven}; 1005227825Stheraven 1006227825Stheraventemplate <class _Hp, class _Tp, size_t _Align> 1007227825Stheravenstruct __find_pod<__type_list<_Hp, _Tp>, _Align> 1008227825Stheraven{ 1009227825Stheraven typedef typename conditional< 1010227825Stheraven _Align == _Hp::value, 1011227825Stheraven typename _Hp::type, 1012227825Stheraven typename __find_pod<_Tp, _Align>::type 1013227825Stheraven >::type type; 1014227825Stheraven}; 1015227825Stheraven 1016227825Stheraventemplate <class _TL, size_t _Len> struct __find_max_align; 1017227825Stheraven 1018227825Stheraventemplate <class _Hp, size_t _Len> 1019227825Stheravenstruct __find_max_align<__type_list<_Hp, __nat>, _Len> : public integral_constant<size_t, _Hp::value> {}; 1020227825Stheraven 1021227825Stheraventemplate <size_t _Len, size_t _A1, size_t _A2> 1022227825Stheravenstruct __select_align 1023227825Stheraven{ 1024227825Stheravenprivate: 1025227825Stheraven static const size_t __min = _A2 < _A1 ? _A2 : _A1; 1026227825Stheraven static const size_t __max = _A1 < _A2 ? _A2 : _A1; 1027227825Stheravenpublic: 1028227825Stheraven static const size_t value = _Len < __max ? __min : __max; 1029227825Stheraven}; 1030227825Stheraven 1031227825Stheraventemplate <class _Hp, class _Tp, size_t _Len> 1032227825Stheravenstruct __find_max_align<__type_list<_Hp, _Tp>, _Len> 1033227825Stheraven : public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {}; 1034227825Stheraven 1035253159Stheraventemplate <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value> 1036249998Sdimstruct _LIBCPP_TYPE_VIS aligned_storage 1037227825Stheraven{ 1038227825Stheraven typedef typename __find_pod<__all_types, _Align>::type _Aligner; 1039227825Stheraven static_assert(!is_void<_Aligner>::value, ""); 1040227825Stheraven union type 1041227825Stheraven { 1042227825Stheraven _Aligner __align; 1043227825Stheraven unsigned char __data[_Len]; 1044227825Stheraven }; 1045227825Stheraven}; 1046227825Stheraven 1047253159Stheraven#if _LIBCPP_STD_VER > 11 1048253159Stheraventemplate <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value> 1049253159Stheraven using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; 1050253159Stheraven#endif 1051253159Stheraven 1052227825Stheraven#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \ 1053227825Stheraventemplate <size_t _Len>\ 1054249998Sdimstruct _LIBCPP_TYPE_VIS aligned_storage<_Len, n>\ 1055227825Stheraven{\ 1056227825Stheraven struct _ALIGNAS(n) type\ 1057227825Stheraven {\ 1058242945Stheraven unsigned char __lx[_Len];\ 1059227825Stheraven };\ 1060227825Stheraven} 1061227825Stheraven 1062227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1); 1063227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2); 1064227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4); 1065227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x8); 1066227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x10); 1067227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x20); 1068227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x40); 1069227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x80); 1070227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x100); 1071227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x200); 1072227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x400); 1073227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x800); 1074227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000); 1075227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000); 1076227825Stheraven// MSDN says that MSVC does not support alignment beyond 8192 (=0x2000) 1077227825Stheraven#if !defined(_MSC_VER) 1078227825Stheraven_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000); 1079227825Stheraven#endif // !_MSC_VER 1080227825Stheraven 1081227825Stheraven#undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION 1082227825Stheraven 1083249998Sdim#ifndef _LIBCPP_HAS_NO_VARIADICS 1084249998Sdim 1085249998Sdim// aligned_union 1086249998Sdim 1087249998Sdimtemplate <size_t _I0, size_t ..._In> 1088249998Sdimstruct __static_max; 1089249998Sdim 1090249998Sdimtemplate <size_t _I0> 1091249998Sdimstruct __static_max<_I0> 1092249998Sdim{ 1093249998Sdim static const size_t value = _I0; 1094249998Sdim}; 1095249998Sdim 1096249998Sdimtemplate <size_t _I0, size_t _I1, size_t ..._In> 1097249998Sdimstruct __static_max<_I0, _I1, _In...> 1098249998Sdim{ 1099249998Sdim static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value : 1100249998Sdim __static_max<_I1, _In...>::value; 1101249998Sdim}; 1102249998Sdim 1103249998Sdimtemplate <size_t _Len, class _Type0, class ..._Types> 1104249998Sdimstruct aligned_union 1105249998Sdim{ 1106249998Sdim static const size_t alignment_value = __static_max<__alignof__(_Type0), 1107249998Sdim __alignof__(_Types)...>::value; 1108249998Sdim static const size_t __len = __static_max<_Len, sizeof(_Type0), 1109249998Sdim sizeof(_Types)...>::value; 1110249998Sdim typedef typename aligned_storage<__len, alignment_value>::type type; 1111249998Sdim}; 1112249998Sdim 1113253159Stheraven#if _LIBCPP_STD_VER > 11 1114253159Stheraventemplate <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type; 1115253159Stheraven#endif 1116253159Stheraven 1117249998Sdim#endif // _LIBCPP_HAS_NO_VARIADICS 1118249998Sdim 1119227825Stheraven// __promote 1120227825Stheraven 1121227825Stheraventemplate <class _A1, class _A2 = void, class _A3 = void, 1122227825Stheraven bool = (is_arithmetic<_A1>::value || is_void<_A1>::value) && 1123227825Stheraven (is_arithmetic<_A2>::value || is_void<_A2>::value) && 1124227825Stheraven (is_arithmetic<_A3>::value || is_void<_A3>::value)> 1125227825Stheravenclass __promote {}; 1126227825Stheraven 1127227825Stheraventemplate <class _A1, class _A2, class _A3> 1128227825Stheravenclass __promote<_A1, _A2, _A3, true> 1129227825Stheraven{ 1130227825Stheravenprivate: 1131227825Stheraven typedef typename __promote<_A1>::type __type1; 1132227825Stheraven typedef typename __promote<_A2>::type __type2; 1133227825Stheraven typedef typename __promote<_A3>::type __type3; 1134227825Stheravenpublic: 1135227825Stheraven typedef decltype(__type1() + __type2() + __type3()) type; 1136227825Stheraven}; 1137227825Stheraven 1138227825Stheraventemplate <class _A1, class _A2> 1139227825Stheravenclass __promote<_A1, _A2, void, true> 1140227825Stheraven{ 1141227825Stheravenprivate: 1142227825Stheraven typedef typename __promote<_A1>::type __type1; 1143227825Stheraven typedef typename __promote<_A2>::type __type2; 1144227825Stheravenpublic: 1145227825Stheraven typedef decltype(__type1() + __type2()) type; 1146227825Stheraven}; 1147227825Stheraven 1148227825Stheraventemplate <class _A1> 1149227825Stheravenclass __promote<_A1, void, void, true> 1150227825Stheraven{ 1151227825Stheravenpublic: 1152227825Stheraven typedef typename conditional<is_arithmetic<_A1>::value, 1153227825Stheraven typename conditional<is_integral<_A1>::value, double, _A1>::type, 1154227825Stheraven void 1155227825Stheraven >::type type; 1156227825Stheraven}; 1157227825Stheraven 1158227825Stheraven#ifdef _LIBCPP_STORE_AS_OPTIMIZATION 1159227825Stheraven 1160227825Stheraven// __transform 1161227825Stheraven 1162227825Stheraventemplate <class _Tp, size_t = sizeof(_Tp), bool = is_scalar<_Tp>::value> struct __transform {typedef _Tp type;}; 1163227825Stheraventemplate <class _Tp> struct __transform<_Tp, 1, true> {typedef unsigned char type;}; 1164227825Stheraventemplate <class _Tp> struct __transform<_Tp, 2, true> {typedef unsigned short type;}; 1165227825Stheraventemplate <class _Tp> struct __transform<_Tp, 4, true> {typedef unsigned int type;}; 1166227825Stheraventemplate <class _Tp> struct __transform<_Tp, 8, true> {typedef unsigned long long type;}; 1167227825Stheraven 1168227825Stheraven#endif // _LIBCPP_STORE_AS_OPTIMIZATION 1169227825Stheraven 1170227825Stheraven// make_signed / make_unsigned 1171227825Stheraven 1172227825Stheraventypedef 1173227825Stheraven __type_list<signed char, 1174227825Stheraven __type_list<signed short, 1175227825Stheraven __type_list<signed int, 1176227825Stheraven __type_list<signed long, 1177227825Stheraven __type_list<signed long long, 1178227825Stheraven __nat 1179227825Stheraven > > > > > __signed_types; 1180227825Stheraven 1181227825Stheraventypedef 1182227825Stheraven __type_list<unsigned char, 1183227825Stheraven __type_list<unsigned short, 1184227825Stheraven __type_list<unsigned int, 1185227825Stheraven __type_list<unsigned long, 1186227825Stheraven __type_list<unsigned long long, 1187227825Stheraven __nat 1188227825Stheraven > > > > > __unsigned_types; 1189227825Stheraven 1190227825Stheraventemplate <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)> struct __find_first; 1191227825Stheraven 1192227825Stheraventemplate <class _Hp, class _Tp, size_t _Size> 1193227825Stheravenstruct __find_first<__type_list<_Hp, _Tp>, _Size, true> 1194227825Stheraven{ 1195227825Stheraven typedef _Hp type; 1196227825Stheraven}; 1197227825Stheraven 1198227825Stheraventemplate <class _Hp, class _Tp, size_t _Size> 1199227825Stheravenstruct __find_first<__type_list<_Hp, _Tp>, _Size, false> 1200227825Stheraven{ 1201227825Stheraven typedef typename __find_first<_Tp, _Size>::type type; 1202227825Stheraven}; 1203227825Stheraven 1204227825Stheraventemplate <class _Tp, class _Up, bool = is_const<typename remove_reference<_Tp>::type>::value, 1205227825Stheraven bool = is_volatile<typename remove_reference<_Tp>::type>::value> 1206227825Stheravenstruct __apply_cv 1207227825Stheraven{ 1208227825Stheraven typedef _Up type; 1209227825Stheraven}; 1210227825Stheraven 1211227825Stheraventemplate <class _Tp, class _Up> 1212227825Stheravenstruct __apply_cv<_Tp, _Up, true, false> 1213227825Stheraven{ 1214227825Stheraven typedef const _Up type; 1215227825Stheraven}; 1216227825Stheraven 1217227825Stheraventemplate <class _Tp, class _Up> 1218227825Stheravenstruct __apply_cv<_Tp, _Up, false, true> 1219227825Stheraven{ 1220227825Stheraven typedef volatile _Up type; 1221227825Stheraven}; 1222227825Stheraven 1223227825Stheraventemplate <class _Tp, class _Up> 1224227825Stheravenstruct __apply_cv<_Tp, _Up, true, true> 1225227825Stheraven{ 1226227825Stheraven typedef const volatile _Up type; 1227227825Stheraven}; 1228227825Stheraven 1229227825Stheraventemplate <class _Tp, class _Up> 1230227825Stheravenstruct __apply_cv<_Tp&, _Up, false, false> 1231227825Stheraven{ 1232227825Stheraven typedef _Up& type; 1233227825Stheraven}; 1234227825Stheraven 1235227825Stheraventemplate <class _Tp, class _Up> 1236227825Stheravenstruct __apply_cv<_Tp&, _Up, true, false> 1237227825Stheraven{ 1238227825Stheraven typedef const _Up& type; 1239227825Stheraven}; 1240227825Stheraven 1241227825Stheraventemplate <class _Tp, class _Up> 1242227825Stheravenstruct __apply_cv<_Tp&, _Up, false, true> 1243227825Stheraven{ 1244227825Stheraven typedef volatile _Up& type; 1245227825Stheraven}; 1246227825Stheraven 1247227825Stheraventemplate <class _Tp, class _Up> 1248227825Stheravenstruct __apply_cv<_Tp&, _Up, true, true> 1249227825Stheraven{ 1250227825Stheraven typedef const volatile _Up& type; 1251227825Stheraven}; 1252227825Stheraven 1253227825Stheraventemplate <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value> 1254227825Stheravenstruct __make_signed {}; 1255227825Stheraven 1256227825Stheraventemplate <class _Tp> 1257227825Stheravenstruct __make_signed<_Tp, true> 1258227825Stheraven{ 1259227825Stheraven typedef typename __find_first<__signed_types, sizeof(_Tp)>::type type; 1260227825Stheraven}; 1261227825Stheraven 1262227825Stheraventemplate <> struct __make_signed<bool, true> {}; 1263227825Stheraventemplate <> struct __make_signed< signed short, true> {typedef short type;}; 1264227825Stheraventemplate <> struct __make_signed<unsigned short, true> {typedef short type;}; 1265227825Stheraventemplate <> struct __make_signed< signed int, true> {typedef int type;}; 1266227825Stheraventemplate <> struct __make_signed<unsigned int, true> {typedef int type;}; 1267227825Stheraventemplate <> struct __make_signed< signed long, true> {typedef long type;}; 1268227825Stheraventemplate <> struct __make_signed<unsigned long, true> {typedef long type;}; 1269227825Stheraventemplate <> struct __make_signed< signed long long, true> {typedef long long type;}; 1270227825Stheraventemplate <> struct __make_signed<unsigned long long, true> {typedef long long type;}; 1271227825Stheraven 1272227825Stheraventemplate <class _Tp> 1273249998Sdimstruct _LIBCPP_TYPE_VIS make_signed 1274227825Stheraven{ 1275227825Stheraven typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type; 1276227825Stheraven}; 1277227825Stheraven 1278253159Stheraven#if _LIBCPP_STD_VER > 11 1279253159Stheraventemplate <class _Tp> using make_signed_t = typename make_signed<_Tp>::type; 1280253159Stheraven#endif 1281253159Stheraven 1282227825Stheraventemplate <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value> 1283227825Stheravenstruct __make_unsigned {}; 1284227825Stheraven 1285227825Stheraventemplate <class _Tp> 1286227825Stheravenstruct __make_unsigned<_Tp, true> 1287227825Stheraven{ 1288227825Stheraven typedef typename __find_first<__unsigned_types, sizeof(_Tp)>::type type; 1289227825Stheraven}; 1290227825Stheraven 1291227825Stheraventemplate <> struct __make_unsigned<bool, true> {}; 1292227825Stheraventemplate <> struct __make_unsigned< signed short, true> {typedef unsigned short type;}; 1293227825Stheraventemplate <> struct __make_unsigned<unsigned short, true> {typedef unsigned short type;}; 1294227825Stheraventemplate <> struct __make_unsigned< signed int, true> {typedef unsigned int type;}; 1295227825Stheraventemplate <> struct __make_unsigned<unsigned int, true> {typedef unsigned int type;}; 1296227825Stheraventemplate <> struct __make_unsigned< signed long, true> {typedef unsigned long type;}; 1297227825Stheraventemplate <> struct __make_unsigned<unsigned long, true> {typedef unsigned long type;}; 1298227825Stheraventemplate <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;}; 1299227825Stheraventemplate <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;}; 1300227825Stheraven 1301227825Stheraventemplate <class _Tp> 1302249998Sdimstruct _LIBCPP_TYPE_VIS make_unsigned 1303227825Stheraven{ 1304227825Stheraven typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type; 1305227825Stheraven}; 1306227825Stheraven 1307253159Stheraven#if _LIBCPP_STD_VER > 11 1308253159Stheraventemplate <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type; 1309253159Stheraven#endif 1310253159Stheraven 1311227825Stheraven#ifdef _LIBCPP_HAS_NO_VARIADICS 1312227825Stheraven 1313227825Stheraventemplate <class _Tp, class _Up = void, class V = void> 1314249998Sdimstruct _LIBCPP_TYPE_VIS common_type 1315227825Stheraven{ 1316227825Stheravenpublic: 1317227825Stheraven typedef typename common_type<typename common_type<_Tp, _Up>::type, V>::type type; 1318227825Stheraven}; 1319227825Stheraven 1320227825Stheraventemplate <class _Tp> 1321249998Sdimstruct _LIBCPP_TYPE_VIS common_type<_Tp, void, void> 1322227825Stheraven{ 1323227825Stheravenpublic: 1324227825Stheraven typedef _Tp type; 1325227825Stheraven}; 1326227825Stheraven 1327227825Stheraventemplate <class _Tp, class _Up> 1328249998Sdimstruct _LIBCPP_TYPE_VIS common_type<_Tp, _Up, void> 1329227825Stheraven{ 1330227825Stheravenprivate: 1331227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 1332227825Stheraven static _Tp&& __t(); 1333227825Stheraven static _Up&& __u(); 1334227825Stheraven#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES 1335227825Stheraven static _Tp __t(); 1336227825Stheraven static _Up __u(); 1337227825Stheraven#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 1338227825Stheravenpublic: 1339232950Stheraven typedef typename remove_reference<decltype(true ? __t() : __u())>::type type; 1340227825Stheraven}; 1341227825Stheraven 1342227825Stheraven#else // _LIBCPP_HAS_NO_VARIADICS 1343227825Stheraven 1344227825Stheraventemplate <class ..._Tp> struct common_type; 1345227825Stheraven 1346227825Stheraventemplate <class _Tp> 1347249998Sdimstruct _LIBCPP_TYPE_VIS common_type<_Tp> 1348227825Stheraven{ 1349227825Stheraven typedef _Tp type; 1350227825Stheraven}; 1351227825Stheraven 1352227825Stheraventemplate <class _Tp, class _Up> 1353249998Sdimstruct _LIBCPP_TYPE_VIS common_type<_Tp, _Up> 1354227825Stheraven{ 1355227825Stheravenprivate: 1356227825Stheraven static _Tp&& __t(); 1357227825Stheraven static _Up&& __u(); 1358227825Stheraven static bool __f(); 1359227825Stheravenpublic: 1360232950Stheraven typedef typename remove_reference<decltype(__f() ? __t() : __u())>::type type; 1361227825Stheraven}; 1362227825Stheraven 1363227825Stheraventemplate <class _Tp, class _Up, class ..._Vp> 1364249998Sdimstruct _LIBCPP_TYPE_VIS common_type<_Tp, _Up, _Vp...> 1365227825Stheraven{ 1366227825Stheraven typedef typename common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type; 1367227825Stheraven}; 1368227825Stheraven 1369253159Stheraven#if _LIBCPP_STD_VER > 11 1370253159Stheraventemplate <class ..._Tp> using common_type_t = typename common_type<_Tp...>::type; 1371253159Stheraven#endif 1372253159Stheraven 1373227825Stheraven#endif // _LIBCPP_HAS_NO_VARIADICS 1374227825Stheraven 1375227825Stheraven// is_assignable 1376227825Stheraven 1377227825Stheraventemplate <class _Tp, class _Arg> 1378227825Stheravendecltype((_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>(), true_type())) 1379227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 1380227825Stheraven__is_assignable_test(_Tp&&, _Arg&&); 1381227825Stheraven#else 1382227825Stheraven__is_assignable_test(_Tp, _Arg&); 1383227825Stheraven#endif 1384227825Stheraven 1385227825Stheraventemplate <class _Arg> 1386227825Stheravenfalse_type 1387227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 1388227825Stheraven__is_assignable_test(__any, _Arg&&); 1389227825Stheraven#else 1390227825Stheraven__is_assignable_test(__any, _Arg&); 1391227825Stheraven#endif 1392227825Stheraven 1393227825Stheraventemplate <class _Tp, class _Arg, bool = is_void<_Tp>::value || is_void<_Arg>::value> 1394227825Stheravenstruct __is_assignable_imp 1395227825Stheraven : public common_type 1396227825Stheraven < 1397227825Stheraven decltype(__is_assignable_test(declval<_Tp>(), declval<_Arg>())) 1398227825Stheraven >::type {}; 1399227825Stheraven 1400227825Stheraventemplate <class _Tp, class _Arg> 1401227825Stheravenstruct __is_assignable_imp<_Tp, _Arg, true> 1402227825Stheraven : public false_type 1403227825Stheraven{ 1404227825Stheraven}; 1405227825Stheraven 1406227825Stheraventemplate <class _Tp, class _Arg> 1407227825Stheravenstruct is_assignable 1408227825Stheraven : public __is_assignable_imp<_Tp, _Arg> {}; 1409227825Stheraven 1410227825Stheraven// is_copy_assignable 1411227825Stheraven 1412249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_copy_assignable 1413227825Stheraven : public is_assignable<typename add_lvalue_reference<_Tp>::type, 1414227825Stheraven const typename add_lvalue_reference<_Tp>::type> {}; 1415227825Stheraven 1416227825Stheraven// is_move_assignable 1417227825Stheraven 1418249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_move_assignable 1419227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 1420227825Stheraven : public is_assignable<typename add_lvalue_reference<_Tp>::type, 1421227825Stheraven const typename add_rvalue_reference<_Tp>::type> {}; 1422227825Stheraven#else 1423227825Stheraven : public is_copy_assignable<_Tp> {}; 1424227825Stheraven#endif 1425227825Stheraven 1426227825Stheraven// is_destructible 1427227825Stheraven 1428227825Stheraventemplate <class _Tp> 1429227825Stheravenstruct __destructible_test 1430227825Stheraven{ 1431227825Stheraven _Tp __t; 1432227825Stheraven}; 1433227825Stheraven 1434227825Stheraventemplate <class _Tp> 1435227825Stheravendecltype((_VSTD::declval<__destructible_test<_Tp> >().~__destructible_test<_Tp>(), true_type())) 1436227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 1437227825Stheraven__is_destructible_test(_Tp&&); 1438227825Stheraven#else 1439227825Stheraven__is_destructible_test(_Tp&); 1440227825Stheraven#endif 1441227825Stheraven 1442227825Stheravenfalse_type 1443227825Stheraven__is_destructible_test(__any); 1444227825Stheraven 1445227825Stheraventemplate <class _Tp, bool = is_void<_Tp>::value || is_abstract<_Tp>::value> 1446227825Stheravenstruct __destructible_imp 1447227825Stheraven : public common_type 1448227825Stheraven < 1449227825Stheraven decltype(__is_destructible_test(declval<_Tp>())) 1450227825Stheraven >::type {}; 1451227825Stheraven 1452227825Stheraventemplate <class _Tp> 1453227825Stheravenstruct __destructible_imp<_Tp, true> 1454227825Stheraven : public false_type {}; 1455227825Stheraven 1456227825Stheraventemplate <class _Tp> 1457227825Stheravenstruct is_destructible 1458227825Stheraven : public __destructible_imp<_Tp> {}; 1459227825Stheraven 1460227825Stheraven// move 1461227825Stheraven 1462227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 1463227825Stheraven 1464227825Stheraventemplate <class _Tp> 1465227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1466227825Stheraventypename remove_reference<_Tp>::type&& 1467227825Stheravenmove(_Tp&& __t) _NOEXCEPT 1468227825Stheraven{ 1469227825Stheraven typedef typename remove_reference<_Tp>::type _Up; 1470227825Stheraven return static_cast<_Up&&>(__t); 1471227825Stheraven} 1472227825Stheraven 1473227825Stheraventemplate <class _Tp> 1474227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1475227825Stheraven_Tp&& 1476227825Stheravenforward(typename std::remove_reference<_Tp>::type& __t) _NOEXCEPT 1477227825Stheraven{ 1478227825Stheraven return static_cast<_Tp&&>(__t); 1479227825Stheraven} 1480227825Stheraven 1481227825Stheraventemplate <class _Tp> 1482227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1483227825Stheraven_Tp&& 1484227825Stheravenforward(typename std::remove_reference<_Tp>::type&& __t) _NOEXCEPT 1485227825Stheraven{ 1486227825Stheraven static_assert(!std::is_lvalue_reference<_Tp>::value, 1487227825Stheraven "Can not forward an rvalue as an lvalue."); 1488227825Stheraven return static_cast<_Tp&&>(__t); 1489227825Stheraven} 1490227825Stheraven 1491227825Stheraven#else // _LIBCPP_HAS_NO_RVALUE_REFERENCES 1492227825Stheraven 1493227825Stheraventemplate <class _Tp> 1494227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1495234976Stheraven_Tp& 1496227825Stheravenmove(_Tp& __t) 1497227825Stheraven{ 1498227825Stheraven return __t; 1499227825Stheraven} 1500227825Stheraven 1501227825Stheraventemplate <class _Tp> 1502227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1503234976Stheravenconst _Tp& 1504232950Stheravenmove(const _Tp& __t) 1505232950Stheraven{ 1506232950Stheraven return __t; 1507232950Stheraven} 1508232950Stheraven 1509232950Stheraventemplate <class _Tp> 1510232950Stheraveninline _LIBCPP_INLINE_VISIBILITY 1511234976Stheraven_Tp& 1512234976Stheravenforward(typename std::remove_reference<_Tp>::type& __t) _NOEXCEPT 1513227825Stheraven{ 1514227825Stheraven return __t; 1515227825Stheraven} 1516227825Stheraven 1517227825Stheraven 1518234976Stheraventemplate <class _Tp> 1519234976Stheravenclass __rv 1520227825Stheraven{ 1521234976Stheraven typedef typename remove_reference<_Tp>::type _Trr; 1522234976Stheraven _Trr& t_; 1523234976Stheravenpublic: 1524234976Stheraven _LIBCPP_INLINE_VISIBILITY 1525234976Stheraven _Trr* operator->() {return &t_;} 1526234976Stheraven _LIBCPP_INLINE_VISIBILITY 1527234976Stheraven explicit __rv(_Trr& __t) : t_(__t) {} 1528234976Stheraven}; 1529227825Stheraven 1530227825Stheraven#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 1531227825Stheraven 1532227825Stheraventemplate <class _Tp> 1533249998Sdimstruct _LIBCPP_TYPE_VIS decay 1534227825Stheraven{ 1535227825Stheravenprivate: 1536227825Stheraven typedef typename remove_reference<_Tp>::type _Up; 1537227825Stheravenpublic: 1538227825Stheraven typedef typename conditional 1539227825Stheraven < 1540227825Stheraven is_array<_Up>::value, 1541227825Stheraven typename remove_extent<_Up>::type*, 1542227825Stheraven typename conditional 1543227825Stheraven < 1544227825Stheraven is_function<_Up>::value, 1545227825Stheraven typename add_pointer<_Up>::type, 1546227825Stheraven typename remove_cv<_Up>::type 1547227825Stheraven >::type 1548227825Stheraven >::type type; 1549227825Stheraven}; 1550227825Stheraven 1551253159Stheraven#if _LIBCPP_STD_VER > 11 1552253159Stheraventemplate <class _Tp> using decay_t = typename decay<_Tp>::type; 1553253159Stheraven#endif 1554253159Stheraven 1555227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 1556227825Stheraven 1557227825Stheraventemplate <class _Tp> 1558227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1559227825Stheraventypename decay<_Tp>::type 1560227825Stheraven__decay_copy(_Tp&& __t) 1561227825Stheraven{ 1562227825Stheraven return _VSTD::forward<_Tp>(__t); 1563227825Stheraven} 1564227825Stheraven 1565227825Stheraven#else 1566227825Stheraven 1567227825Stheraventemplate <class _Tp> 1568227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 1569227825Stheraventypename decay<_Tp>::type 1570227825Stheraven__decay_copy(const _Tp& __t) 1571227825Stheraven{ 1572227825Stheraven return _VSTD::forward<_Tp>(__t); 1573227825Stheraven} 1574227825Stheraven 1575227825Stheraven#endif 1576227825Stheraven 1577227825Stheraventemplate <class _MP, bool _IsMemberFuctionPtr, bool _IsMemberObjectPtr> 1578227825Stheravenstruct __member_pointer_traits_imp 1579227825Stheraven{ 1580227825Stheraven}; 1581227825Stheraven 1582227825Stheraven#ifndef _LIBCPP_HAS_NO_VARIADICS 1583227825Stheraven 1584232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1585232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false> 1586227825Stheraven{ 1587227825Stheraven typedef _Class _ClassType; 1588232950Stheraven typedef _Rp _ReturnType; 1589227825Stheraven}; 1590227825Stheraven 1591232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1592232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false> 1593227825Stheraven{ 1594227825Stheraven typedef _Class const _ClassType; 1595232950Stheraven typedef _Rp _ReturnType; 1596227825Stheraven}; 1597227825Stheraven 1598232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1599232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false> 1600227825Stheraven{ 1601227825Stheraven typedef _Class volatile _ClassType; 1602232950Stheraven typedef _Rp _ReturnType; 1603227825Stheraven}; 1604227825Stheraven 1605232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1606232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false> 1607227825Stheraven{ 1608227825Stheraven typedef _Class const volatile _ClassType; 1609232950Stheraven typedef _Rp _ReturnType; 1610227825Stheraven}; 1611227825Stheraven 1612227825Stheraven#if __has_feature(cxx_reference_qualified_functions) 1613227825Stheraven 1614232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1615232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false> 1616227825Stheraven{ 1617227825Stheraven typedef _Class& _ClassType; 1618232950Stheraven typedef _Rp _ReturnType; 1619227825Stheraven}; 1620227825Stheraven 1621232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1622232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false> 1623227825Stheraven{ 1624227825Stheraven typedef _Class const& _ClassType; 1625232950Stheraven typedef _Rp _ReturnType; 1626227825Stheraven}; 1627227825Stheraven 1628232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1629232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false> 1630227825Stheraven{ 1631227825Stheraven typedef _Class volatile& _ClassType; 1632232950Stheraven typedef _Rp _ReturnType; 1633227825Stheraven}; 1634227825Stheraven 1635232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1636232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false> 1637227825Stheraven{ 1638227825Stheraven typedef _Class const volatile& _ClassType; 1639232950Stheraven typedef _Rp _ReturnType; 1640227825Stheraven}; 1641227825Stheraven 1642232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1643232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false> 1644227825Stheraven{ 1645227825Stheraven typedef _Class&& _ClassType; 1646232950Stheraven typedef _Rp _ReturnType; 1647227825Stheraven}; 1648227825Stheraven 1649232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1650232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false> 1651227825Stheraven{ 1652227825Stheraven typedef _Class const&& _ClassType; 1653232950Stheraven typedef _Rp _ReturnType; 1654227825Stheraven}; 1655227825Stheraven 1656232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1657232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false> 1658227825Stheraven{ 1659227825Stheraven typedef _Class volatile&& _ClassType; 1660232950Stheraven typedef _Rp _ReturnType; 1661227825Stheraven}; 1662227825Stheraven 1663232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 1664232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false> 1665227825Stheraven{ 1666227825Stheraven typedef _Class const volatile&& _ClassType; 1667232950Stheraven typedef _Rp _ReturnType; 1668227825Stheraven}; 1669227825Stheraven 1670227825Stheraven#endif // __has_feature(cxx_reference_qualified_functions) 1671227825Stheraven 1672227825Stheraven#else // _LIBCPP_HAS_NO_VARIADICS 1673227825Stheraven 1674232950Stheraventemplate <class _Rp, class _Class> 1675232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false> 1676227825Stheraven{ 1677227825Stheraven typedef _Class _ClassType; 1678232950Stheraven typedef _Rp _ReturnType; 1679227825Stheraven}; 1680227825Stheraven 1681232950Stheraventemplate <class _Rp, class _Class, class _P0> 1682232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false> 1683227825Stheraven{ 1684227825Stheraven typedef _Class _ClassType; 1685232950Stheraven typedef _Rp _ReturnType; 1686227825Stheraven}; 1687227825Stheraven 1688232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1> 1689232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false> 1690227825Stheraven{ 1691227825Stheraven typedef _Class _ClassType; 1692232950Stheraven typedef _Rp _ReturnType; 1693227825Stheraven}; 1694227825Stheraven 1695232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1, class _P2> 1696232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false> 1697227825Stheraven{ 1698227825Stheraven typedef _Class _ClassType; 1699232950Stheraven typedef _Rp _ReturnType; 1700227825Stheraven}; 1701227825Stheraven 1702232950Stheraventemplate <class _Rp, class _Class> 1703232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false> 1704227825Stheraven{ 1705227825Stheraven typedef _Class const _ClassType; 1706232950Stheraven typedef _Rp _ReturnType; 1707227825Stheraven}; 1708227825Stheraven 1709232950Stheraventemplate <class _Rp, class _Class, class _P0> 1710232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false> 1711227825Stheraven{ 1712227825Stheraven typedef _Class const _ClassType; 1713232950Stheraven typedef _Rp _ReturnType; 1714227825Stheraven}; 1715227825Stheraven 1716232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1> 1717232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false> 1718227825Stheraven{ 1719227825Stheraven typedef _Class const _ClassType; 1720232950Stheraven typedef _Rp _ReturnType; 1721227825Stheraven}; 1722227825Stheraven 1723232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1, class _P2> 1724232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false> 1725227825Stheraven{ 1726227825Stheraven typedef _Class const _ClassType; 1727232950Stheraven typedef _Rp _ReturnType; 1728227825Stheraven}; 1729227825Stheraven 1730232950Stheraventemplate <class _Rp, class _Class> 1731232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false> 1732227825Stheraven{ 1733227825Stheraven typedef _Class volatile _ClassType; 1734232950Stheraven typedef _Rp _ReturnType; 1735227825Stheraven}; 1736227825Stheraven 1737232950Stheraventemplate <class _Rp, class _Class, class _P0> 1738232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false> 1739227825Stheraven{ 1740227825Stheraven typedef _Class volatile _ClassType; 1741232950Stheraven typedef _Rp _ReturnType; 1742227825Stheraven}; 1743227825Stheraven 1744232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1> 1745232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false> 1746227825Stheraven{ 1747227825Stheraven typedef _Class volatile _ClassType; 1748232950Stheraven typedef _Rp _ReturnType; 1749227825Stheraven}; 1750227825Stheraven 1751232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1, class _P2> 1752232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false> 1753227825Stheraven{ 1754227825Stheraven typedef _Class volatile _ClassType; 1755232950Stheraven typedef _Rp _ReturnType; 1756227825Stheraven}; 1757227825Stheraven 1758232950Stheraventemplate <class _Rp, class _Class> 1759232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false> 1760227825Stheraven{ 1761227825Stheraven typedef _Class const volatile _ClassType; 1762232950Stheraven typedef _Rp _ReturnType; 1763227825Stheraven}; 1764227825Stheraven 1765232950Stheraventemplate <class _Rp, class _Class, class _P0> 1766232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false> 1767227825Stheraven{ 1768227825Stheraven typedef _Class const volatile _ClassType; 1769232950Stheraven typedef _Rp _ReturnType; 1770227825Stheraven}; 1771227825Stheraven 1772232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1> 1773232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false> 1774227825Stheraven{ 1775227825Stheraven typedef _Class const volatile _ClassType; 1776232950Stheraven typedef _Rp _ReturnType; 1777227825Stheraven}; 1778227825Stheraven 1779232950Stheraventemplate <class _Rp, class _Class, class _P0, class _P1, class _P2> 1780232950Stheravenstruct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false> 1781227825Stheraven{ 1782227825Stheraven typedef _Class const volatile _ClassType; 1783232950Stheraven typedef _Rp _ReturnType; 1784227825Stheraven}; 1785227825Stheraven 1786227825Stheraven#endif // _LIBCPP_HAS_NO_VARIADICS 1787227825Stheraven 1788232950Stheraventemplate <class _Rp, class _Class> 1789232950Stheravenstruct __member_pointer_traits_imp<_Rp _Class::*, false, true> 1790227825Stheraven{ 1791227825Stheraven typedef _Class _ClassType; 1792232950Stheraven typedef _Rp _ReturnType; 1793227825Stheraven}; 1794227825Stheraven 1795227825Stheraventemplate <class _MP> 1796227825Stheravenstruct __member_pointer_traits 1797253159Stheraven : public __member_pointer_traits_imp<typename remove_cv<_MP>::type, 1798227825Stheraven is_member_function_pointer<_MP>::value, 1799227825Stheraven is_member_object_pointer<_MP>::value> 1800227825Stheraven{ 1801227825Stheraven// typedef ... _ClassType; 1802227825Stheraven// typedef ... _ReturnType; 1803227825Stheraven}; 1804227825Stheraven 1805227825Stheraven// result_of 1806227825Stheraven 1807227825Stheraventemplate <class _Callable> class result_of; 1808227825Stheraven 1809241903Sdim#ifdef _LIBCPP_HAS_NO_VARIADICS 1810241903Sdim 1811227825Stheraventemplate <class _Fn, bool, bool> 1812227825Stheravenclass __result_of 1813227825Stheraven{ 1814227825Stheraven}; 1815227825Stheraven 1816227825Stheraventemplate <class _Fn> 1817227825Stheravenclass __result_of<_Fn(), true, false> 1818227825Stheraven{ 1819227825Stheravenpublic: 1820227825Stheraven typedef decltype(declval<_Fn>()()) type; 1821227825Stheraven}; 1822227825Stheraven 1823227825Stheraventemplate <class _Fn, class _A0> 1824227825Stheravenclass __result_of<_Fn(_A0), true, false> 1825227825Stheraven{ 1826227825Stheravenpublic: 1827227825Stheraven typedef decltype(declval<_Fn>()(declval<_A0>())) type; 1828227825Stheraven}; 1829227825Stheraven 1830227825Stheraventemplate <class _Fn, class _A0, class _A1> 1831227825Stheravenclass __result_of<_Fn(_A0, _A1), true, false> 1832227825Stheraven{ 1833227825Stheravenpublic: 1834227825Stheraven typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>())) type; 1835227825Stheraven}; 1836227825Stheraven 1837227825Stheraventemplate <class _Fn, class _A0, class _A1, class _A2> 1838227825Stheravenclass __result_of<_Fn(_A0, _A1, _A2), true, false> 1839227825Stheraven{ 1840227825Stheravenpublic: 1841227825Stheraven typedef decltype(declval<_Fn>()(declval<_A0>(), declval<_A1>(), declval<_A2>())) type; 1842227825Stheraven}; 1843227825Stheraven 1844227825Stheraventemplate <class _MP, class _Tp, bool _IsMemberFunctionPtr> 1845227825Stheravenstruct __result_of_mp; 1846227825Stheraven 1847227825Stheraven// member function pointer 1848227825Stheraven 1849227825Stheraventemplate <class _MP, class _Tp> 1850227825Stheravenstruct __result_of_mp<_MP, _Tp, true> 1851227825Stheraven : public common_type<typename __member_pointer_traits<_MP>::_ReturnType> 1852227825Stheraven{ 1853227825Stheraven}; 1854227825Stheraven 1855227825Stheraven// member data pointer 1856227825Stheraven 1857227825Stheraventemplate <class _MP, class _Tp, bool> 1858227825Stheravenstruct __result_of_mdp; 1859227825Stheraven 1860232950Stheraventemplate <class _Rp, class _Class, class _Tp> 1861232950Stheravenstruct __result_of_mdp<_Rp _Class::*, _Tp, false> 1862227825Stheraven{ 1863232950Stheraven typedef typename __apply_cv<decltype(*_VSTD::declval<_Tp>()), _Rp>::type& type; 1864227825Stheraven}; 1865227825Stheraven 1866232950Stheraventemplate <class _Rp, class _Class, class _Tp> 1867232950Stheravenstruct __result_of_mdp<_Rp _Class::*, _Tp, true> 1868227825Stheraven{ 1869232950Stheraven typedef typename __apply_cv<_Tp, _Rp>::type& type; 1870227825Stheraven}; 1871227825Stheraven 1872232950Stheraventemplate <class _Rp, class _Class, class _Tp> 1873232950Stheravenstruct __result_of_mp<_Rp _Class::*, _Tp, false> 1874232950Stheraven : public __result_of_mdp<_Rp _Class::*, _Tp, 1875227825Stheraven is_base_of<_Class, typename remove_reference<_Tp>::type>::value> 1876227825Stheraven{ 1877227825Stheraven}; 1878227825Stheraven 1879227825Stheraven 1880227825Stheraven 1881227825Stheraventemplate <class _Fn, class _Tp> 1882227825Stheravenclass __result_of<_Fn(_Tp), false, true> // _Fn must be member pointer 1883227825Stheraven : public __result_of_mp<typename remove_reference<_Fn>::type, 1884227825Stheraven _Tp, 1885227825Stheraven is_member_function_pointer<typename remove_reference<_Fn>::type>::value> 1886227825Stheraven{ 1887227825Stheraven}; 1888227825Stheraven 1889227825Stheraventemplate <class _Fn, class _Tp, class _A0> 1890227825Stheravenclass __result_of<_Fn(_Tp, _A0), false, true> // _Fn must be member pointer 1891227825Stheraven : public __result_of_mp<typename remove_reference<_Fn>::type, 1892227825Stheraven _Tp, 1893227825Stheraven is_member_function_pointer<typename remove_reference<_Fn>::type>::value> 1894227825Stheraven{ 1895227825Stheraven}; 1896227825Stheraven 1897227825Stheraventemplate <class _Fn, class _Tp, class _A0, class _A1> 1898227825Stheravenclass __result_of<_Fn(_Tp, _A0, _A1), false, true> // _Fn must be member pointer 1899227825Stheraven : public __result_of_mp<typename remove_reference<_Fn>::type, 1900227825Stheraven _Tp, 1901227825Stheraven is_member_function_pointer<typename remove_reference<_Fn>::type>::value> 1902227825Stheraven{ 1903227825Stheraven}; 1904227825Stheraven 1905227825Stheraventemplate <class _Fn, class _Tp, class _A0, class _A1, class _A2> 1906227825Stheravenclass __result_of<_Fn(_Tp, _A0, _A1, _A2), false, true> // _Fn must be member pointer 1907227825Stheraven : public __result_of_mp<typename remove_reference<_Fn>::type, 1908227825Stheraven _Tp, 1909227825Stheraven is_member_function_pointer<typename remove_reference<_Fn>::type>::value> 1910227825Stheraven{ 1911227825Stheraven}; 1912227825Stheraven 1913227825Stheraven// result_of 1914227825Stheraven 1915227825Stheraventemplate <class _Fn> 1916249998Sdimclass _LIBCPP_TYPE_VIS result_of<_Fn()> 1917227825Stheraven : public __result_of<_Fn(), 1918227825Stheraven is_class<typename remove_reference<_Fn>::type>::value || 1919227825Stheraven is_function<typename remove_reference<_Fn>::type>::value, 1920227825Stheraven is_member_pointer<typename remove_reference<_Fn>::type>::value 1921227825Stheraven > 1922227825Stheraven{ 1923227825Stheraven}; 1924227825Stheraven 1925227825Stheraventemplate <class _Fn, class _A0> 1926249998Sdimclass _LIBCPP_TYPE_VIS result_of<_Fn(_A0)> 1927227825Stheraven : public __result_of<_Fn(_A0), 1928227825Stheraven is_class<typename remove_reference<_Fn>::type>::value || 1929227825Stheraven is_function<typename remove_reference<_Fn>::type>::value, 1930227825Stheraven is_member_pointer<typename remove_reference<_Fn>::type>::value 1931227825Stheraven > 1932227825Stheraven{ 1933227825Stheraven}; 1934227825Stheraven 1935227825Stheraventemplate <class _Fn, class _A0, class _A1> 1936249998Sdimclass _LIBCPP_TYPE_VIS result_of<_Fn(_A0, _A1)> 1937227825Stheraven : public __result_of<_Fn(_A0, _A1), 1938227825Stheraven is_class<typename remove_reference<_Fn>::type>::value || 1939227825Stheraven is_function<typename remove_reference<_Fn>::type>::value, 1940227825Stheraven is_member_pointer<typename remove_reference<_Fn>::type>::value 1941227825Stheraven > 1942227825Stheraven{ 1943227825Stheraven}; 1944227825Stheraven 1945227825Stheraventemplate <class _Fn, class _A0, class _A1, class _A2> 1946249998Sdimclass _LIBCPP_TYPE_VIS result_of<_Fn(_A0, _A1, _A2)> 1947227825Stheraven : public __result_of<_Fn(_A0, _A1, _A2), 1948227825Stheraven is_class<typename remove_reference<_Fn>::type>::value || 1949227825Stheraven is_function<typename remove_reference<_Fn>::type>::value, 1950227825Stheraven is_member_pointer<typename remove_reference<_Fn>::type>::value 1951227825Stheraven > 1952227825Stheraven{ 1953227825Stheraven}; 1954227825Stheraven 1955227825Stheraven#endif // _LIBCPP_HAS_NO_VARIADICS 1956227825Stheraven 1957227825Stheraven#ifndef _LIBCPP_HAS_NO_VARIADICS 1958227825Stheraven 1959227825Stheraven// template <class T, class... Args> struct is_constructible; 1960227825Stheraven 1961227825Stheraven// main is_constructible test 1962227825Stheraven 1963242945Stheraventemplate<typename, typename T> struct __select_2nd { typedef T type; }; 1964242945Stheraven 1965227825Stheraventemplate <class _Tp, class ..._Args> 1966242945Stheraventypename __select_2nd<decltype(_VSTD::move(_Tp(_VSTD::declval<_Args>()...))), true_type>::type 1967227825Stheraven__is_constructible_test(_Tp&&, _Args&& ...); 1968227825Stheraven 1969227825Stheraventemplate <class ..._Args> 1970227825Stheravenfalse_type 1971227825Stheraven__is_constructible_test(__any, _Args&& ...); 1972227825Stheraven 1973227825Stheraventemplate <bool, class _Tp, class... _Args> 1974227825Stheravenstruct __is_constructible // false, _Tp is not a scalar 1975227825Stheraven : public common_type 1976227825Stheraven < 1977227825Stheraven decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...)) 1978227825Stheraven >::type 1979227825Stheraven {}; 1980227825Stheraven 1981227825Stheraven// function types are not constructible 1982227825Stheraven 1983232950Stheraventemplate <class _Rp, class... _A1, class... _A2> 1984232950Stheravenstruct __is_constructible<false, _Rp(_A1...), _A2...> 1985227825Stheraven : public false_type 1986227825Stheraven {}; 1987227825Stheraven 1988227825Stheraven// handle scalars and reference types 1989227825Stheraven 1990227825Stheraven// Scalars are default constructible, references are not 1991227825Stheraven 1992227825Stheraventemplate <class _Tp> 1993227825Stheravenstruct __is_constructible<true, _Tp> 1994227825Stheraven : public is_scalar<_Tp> 1995227825Stheraven {}; 1996227825Stheraven 1997227825Stheraven// Scalars and references are constructible from one arg if that arg is 1998227825Stheraven// implicitly convertible to the scalar or reference. 1999227825Stheraven 2000227825Stheraventemplate <class _Tp> 2001227825Stheravenstruct __is_constructible_ref 2002227825Stheraven{ 2003242945Stheraven true_type static __lxx(_Tp); 2004242945Stheraven false_type static __lxx(...); 2005227825Stheraven}; 2006227825Stheraven 2007227825Stheraventemplate <class _Tp, class _A0> 2008227825Stheravenstruct __is_constructible<true, _Tp, _A0> 2009227825Stheraven : public common_type 2010227825Stheraven < 2011242945Stheraven decltype(__is_constructible_ref<_Tp>::__lxx(declval<_A0>())) 2012227825Stheraven >::type 2013227825Stheraven {}; 2014227825Stheraven 2015227825Stheraven// Scalars and references are not constructible from multiple args. 2016227825Stheraven 2017227825Stheraventemplate <class _Tp, class _A0, class ..._Args> 2018227825Stheravenstruct __is_constructible<true, _Tp, _A0, _Args...> 2019227825Stheraven : public false_type 2020227825Stheraven {}; 2021227825Stheraven 2022227825Stheraven// Treat scalars and reference types separately 2023227825Stheraven 2024227825Stheraventemplate <bool, class _Tp, class... _Args> 2025227825Stheravenstruct __is_constructible_void_check 2026227825Stheraven : public __is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value, 2027227825Stheraven _Tp, _Args...> 2028227825Stheraven {}; 2029227825Stheraven 2030227825Stheraven// If any of T or Args is void, is_constructible should be false 2031227825Stheraven 2032227825Stheraventemplate <class _Tp, class... _Args> 2033227825Stheravenstruct __is_constructible_void_check<true, _Tp, _Args...> 2034227825Stheraven : public false_type 2035227825Stheraven {}; 2036227825Stheraven 2037227825Stheraventemplate <class ..._Args> struct __contains_void; 2038227825Stheraven 2039227825Stheraventemplate <> struct __contains_void<> : false_type {}; 2040227825Stheraven 2041227825Stheraventemplate <class _A0, class ..._Args> 2042227825Stheravenstruct __contains_void<_A0, _Args...> 2043227825Stheraven{ 2044227825Stheraven static const bool value = is_void<_A0>::value || 2045227825Stheraven __contains_void<_Args...>::value; 2046227825Stheraven}; 2047227825Stheraven 2048227825Stheraven// is_constructible entry point 2049227825Stheraven 2050227825Stheraventemplate <class _Tp, class... _Args> 2051249998Sdimstruct _LIBCPP_TYPE_VIS is_constructible 2052227825Stheraven : public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value 2053227825Stheraven || is_abstract<_Tp>::value, 2054227825Stheraven _Tp, _Args...> 2055227825Stheraven {}; 2056227825Stheraven 2057227825Stheraven// Array types are default constructible if their element type 2058227825Stheraven// is default constructible 2059227825Stheraven 2060232950Stheraventemplate <class _Ap, size_t _Np> 2061232950Stheravenstruct __is_constructible<false, _Ap[_Np]> 2062232950Stheraven : public is_constructible<typename remove_all_extents<_Ap>::type> 2063227825Stheraven {}; 2064227825Stheraven 2065227825Stheraven// Otherwise array types are not constructible by this syntax 2066227825Stheraven 2067232950Stheraventemplate <class _Ap, size_t _Np, class ..._Args> 2068232950Stheravenstruct __is_constructible<false, _Ap[_Np], _Args...> 2069227825Stheraven : public false_type 2070227825Stheraven {}; 2071227825Stheraven 2072227825Stheraven// Incomplete array types are not constructible 2073227825Stheraven 2074232950Stheraventemplate <class _Ap, class ..._Args> 2075232950Stheravenstruct __is_constructible<false, _Ap[], _Args...> 2076227825Stheraven : public false_type 2077227825Stheraven {}; 2078227825Stheraven 2079227825Stheraven#else // _LIBCPP_HAS_NO_VARIADICS 2080227825Stheraven 2081227825Stheraven// template <class T> struct is_constructible0; 2082227825Stheraven 2083227825Stheraven// main is_constructible0 test 2084227825Stheraven 2085227825Stheraventemplate <class _Tp> 2086227825Stheravendecltype((_Tp(), true_type())) 2087227825Stheraven__is_constructible0_test(_Tp&); 2088227825Stheraven 2089227825Stheravenfalse_type 2090227825Stheraven__is_constructible0_test(__any); 2091227825Stheraven 2092227825Stheraventemplate <class _Tp, class _A0> 2093227825Stheravendecltype((_Tp(_VSTD::declval<_A0>()), true_type())) 2094227825Stheraven__is_constructible1_test(_Tp&, _A0&); 2095227825Stheraven 2096227825Stheraventemplate <class _A0> 2097227825Stheravenfalse_type 2098227825Stheraven__is_constructible1_test(__any, _A0&); 2099227825Stheraven 2100227825Stheraventemplate <class _Tp, class _A0, class _A1> 2101227825Stheravendecltype((_Tp(_VSTD::declval<_A0>(), _VSTD::declval<_A1>()), true_type())) 2102227825Stheraven__is_constructible2_test(_Tp&, _A0&, _A1&); 2103227825Stheraven 2104227825Stheraventemplate <class _A0, class _A1> 2105227825Stheravenfalse_type 2106227825Stheraven__is_constructible2_test(__any, _A0&, _A1&); 2107227825Stheraven 2108227825Stheraventemplate <bool, class _Tp> 2109227825Stheravenstruct __is_constructible0_imp // false, _Tp is not a scalar 2110227825Stheraven : public common_type 2111227825Stheraven < 2112227825Stheraven decltype(__is_constructible0_test(declval<_Tp&>())) 2113227825Stheraven >::type 2114227825Stheraven {}; 2115227825Stheraven 2116227825Stheraventemplate <bool, class _Tp, class _A0> 2117227825Stheravenstruct __is_constructible1_imp // false, _Tp is not a scalar 2118227825Stheraven : public common_type 2119227825Stheraven < 2120227825Stheraven decltype(__is_constructible1_test(declval<_Tp&>(), declval<_A0&>())) 2121227825Stheraven >::type 2122227825Stheraven {}; 2123227825Stheraven 2124227825Stheraventemplate <bool, class _Tp, class _A0, class _A1> 2125227825Stheravenstruct __is_constructible2_imp // false, _Tp is not a scalar 2126227825Stheraven : public common_type 2127227825Stheraven < 2128227825Stheraven decltype(__is_constructible2_test(declval<_Tp&>(), declval<_A0>(), declval<_A1>())) 2129227825Stheraven >::type 2130227825Stheraven {}; 2131227825Stheraven 2132227825Stheraven// handle scalars and reference types 2133227825Stheraven 2134227825Stheraven// Scalars are default constructible, references are not 2135227825Stheraven 2136227825Stheraventemplate <class _Tp> 2137227825Stheravenstruct __is_constructible0_imp<true, _Tp> 2138227825Stheraven : public is_scalar<_Tp> 2139227825Stheraven {}; 2140227825Stheraven 2141227825Stheraventemplate <class _Tp, class _A0> 2142227825Stheravenstruct __is_constructible1_imp<true, _Tp, _A0> 2143227825Stheraven : public is_convertible<_A0, _Tp> 2144227825Stheraven {}; 2145227825Stheraven 2146227825Stheraventemplate <class _Tp, class _A0, class _A1> 2147227825Stheravenstruct __is_constructible2_imp<true, _Tp, _A0, _A1> 2148227825Stheraven : public false_type 2149227825Stheraven {}; 2150227825Stheraven 2151227825Stheraven// Treat scalars and reference types separately 2152227825Stheraven 2153227825Stheraventemplate <bool, class _Tp> 2154227825Stheravenstruct __is_constructible0_void_check 2155227825Stheraven : public __is_constructible0_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, 2156227825Stheraven _Tp> 2157227825Stheraven {}; 2158227825Stheraven 2159227825Stheraventemplate <bool, class _Tp, class _A0> 2160227825Stheravenstruct __is_constructible1_void_check 2161227825Stheraven : public __is_constructible1_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, 2162227825Stheraven _Tp, _A0> 2163227825Stheraven {}; 2164227825Stheraven 2165227825Stheraventemplate <bool, class _Tp, class _A0, class _A1> 2166227825Stheravenstruct __is_constructible2_void_check 2167227825Stheraven : public __is_constructible2_imp<is_scalar<_Tp>::value || is_reference<_Tp>::value, 2168227825Stheraven _Tp, _A0, _A1> 2169227825Stheraven {}; 2170227825Stheraven 2171227825Stheraven// If any of T or Args is void, is_constructible should be false 2172227825Stheraven 2173227825Stheraventemplate <class _Tp> 2174227825Stheravenstruct __is_constructible0_void_check<true, _Tp> 2175227825Stheraven : public false_type 2176227825Stheraven {}; 2177227825Stheraven 2178227825Stheraventemplate <class _Tp, class _A0> 2179227825Stheravenstruct __is_constructible1_void_check<true, _Tp, _A0> 2180227825Stheraven : public false_type 2181227825Stheraven {}; 2182227825Stheraven 2183227825Stheraventemplate <class _Tp, class _A0, class _A1> 2184227825Stheravenstruct __is_constructible2_void_check<true, _Tp, _A0, _A1> 2185227825Stheraven : public false_type 2186227825Stheraven {}; 2187227825Stheraven 2188227825Stheraven// is_constructible entry point 2189227825Stheraven 2190227825Stheravennamespace __is_construct 2191227825Stheraven{ 2192227825Stheraven 2193227825Stheravenstruct __nat {}; 2194227825Stheraven 2195227825Stheraven} 2196227825Stheraven 2197227825Stheraventemplate <class _Tp, class _A0 = __is_construct::__nat, 2198227825Stheraven class _A1 = __is_construct::__nat> 2199249998Sdimstruct _LIBCPP_TYPE_VIS is_constructible 2200227825Stheraven : public __is_constructible2_void_check<is_void<_Tp>::value 2201227825Stheraven || is_abstract<_Tp>::value 2202227825Stheraven || is_function<_Tp>::value 2203227825Stheraven || is_void<_A0>::value 2204227825Stheraven || is_void<_A1>::value, 2205227825Stheraven _Tp, _A0, _A1> 2206227825Stheraven {}; 2207227825Stheraven 2208227825Stheraventemplate <class _Tp> 2209249998Sdimstruct _LIBCPP_TYPE_VIS is_constructible<_Tp, __is_construct::__nat, __is_construct::__nat> 2210227825Stheraven : public __is_constructible0_void_check<is_void<_Tp>::value 2211227825Stheraven || is_abstract<_Tp>::value 2212227825Stheraven || is_function<_Tp>::value, 2213227825Stheraven _Tp> 2214227825Stheraven {}; 2215227825Stheraven 2216227825Stheraventemplate <class _Tp, class _A0> 2217249998Sdimstruct _LIBCPP_TYPE_VIS is_constructible<_Tp, _A0, __is_construct::__nat> 2218227825Stheraven : public __is_constructible1_void_check<is_void<_Tp>::value 2219227825Stheraven || is_abstract<_Tp>::value 2220227825Stheraven || is_function<_Tp>::value 2221227825Stheraven || is_void<_A0>::value, 2222227825Stheraven _Tp, _A0> 2223227825Stheraven {}; 2224227825Stheraven 2225227825Stheraven// Array types are default constructible if their element type 2226227825Stheraven// is default constructible 2227227825Stheraven 2228232950Stheraventemplate <class _Ap, size_t _Np> 2229232950Stheravenstruct __is_constructible0_imp<false, _Ap[_Np]> 2230232950Stheraven : public is_constructible<typename remove_all_extents<_Ap>::type> 2231227825Stheraven {}; 2232227825Stheraven 2233232950Stheraventemplate <class _Ap, size_t _Np, class _A0> 2234232950Stheravenstruct __is_constructible1_imp<false, _Ap[_Np], _A0> 2235227825Stheraven : public false_type 2236227825Stheraven {}; 2237227825Stheraven 2238232950Stheraventemplate <class _Ap, size_t _Np, class _A0, class _A1> 2239232950Stheravenstruct __is_constructible2_imp<false, _Ap[_Np], _A0, _A1> 2240227825Stheraven : public false_type 2241227825Stheraven {}; 2242227825Stheraven 2243227825Stheraven// Incomplete array types are not constructible 2244227825Stheraven 2245232950Stheraventemplate <class _Ap> 2246232950Stheravenstruct __is_constructible0_imp<false, _Ap[]> 2247227825Stheraven : public false_type 2248227825Stheraven {}; 2249227825Stheraven 2250232950Stheraventemplate <class _Ap, class _A0> 2251232950Stheravenstruct __is_constructible1_imp<false, _Ap[], _A0> 2252227825Stheraven : public false_type 2253227825Stheraven {}; 2254227825Stheraven 2255232950Stheraventemplate <class _Ap, class _A0, class _A1> 2256232950Stheravenstruct __is_constructible2_imp<false, _Ap[], _A0, _A1> 2257227825Stheraven : public false_type 2258227825Stheraven {}; 2259227825Stheraven 2260227825Stheraven#endif // _LIBCPP_HAS_NO_VARIADICS 2261227825Stheraven 2262227825Stheraven// is_default_constructible 2263227825Stheraven 2264227825Stheraventemplate <class _Tp> 2265249998Sdimstruct _LIBCPP_TYPE_VIS is_default_constructible 2266227825Stheraven : public is_constructible<_Tp> 2267227825Stheraven {}; 2268227825Stheraven 2269227825Stheraven// is_copy_constructible 2270227825Stheraven 2271227825Stheraventemplate <class _Tp> 2272249998Sdimstruct _LIBCPP_TYPE_VIS is_copy_constructible 2273227825Stheraven : public is_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type> 2274227825Stheraven {}; 2275227825Stheraven 2276227825Stheraven// is_move_constructible 2277227825Stheraven 2278227825Stheraventemplate <class _Tp> 2279249998Sdimstruct _LIBCPP_TYPE_VIS is_move_constructible 2280227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2281227825Stheraven : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> 2282227825Stheraven#else 2283227825Stheraven : public is_copy_constructible<_Tp> 2284227825Stheraven#endif 2285227825Stheraven {}; 2286227825Stheraven 2287227825Stheraven// is_trivially_constructible 2288227825Stheraven 2289227825Stheraven#ifndef _LIBCPP_HAS_NO_VARIADICS 2290227825Stheraven 2291232950Stheraven#if __has_feature(is_trivially_constructible) 2292232950Stheraven 2293227825Stheraventemplate <class _Tp, class... _Args> 2294249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible 2295232950Stheraven : integral_constant<bool, __is_trivially_constructible(_Tp, _Args...)> 2296232950Stheraven{ 2297232950Stheraven}; 2298232950Stheraven 2299232950Stheraven#else // !__has_feature(is_trivially_constructible) 2300232950Stheraven 2301232950Stheraventemplate <class _Tp, class... _Args> 2302249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible 2303227825Stheraven : false_type 2304227825Stheraven{ 2305227825Stheraven}; 2306227825Stheraven 2307227825Stheraventemplate <class _Tp> 2308249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp> 2309227825Stheraven#if __has_feature(has_trivial_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2310227825Stheraven : integral_constant<bool, __has_trivial_constructor(_Tp)> 2311227825Stheraven#else 2312227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2313227825Stheraven#endif 2314227825Stheraven{ 2315227825Stheraven}; 2316227825Stheraven 2317227825Stheraventemplate <class _Tp> 2318227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2319249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&&> 2320227825Stheraven#else 2321249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp> 2322227825Stheraven#endif 2323227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2324227825Stheraven{ 2325227825Stheraven}; 2326227825Stheraven 2327227825Stheraventemplate <class _Tp> 2328249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, const _Tp&> 2329227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2330227825Stheraven{ 2331227825Stheraven}; 2332227825Stheraven 2333227825Stheraventemplate <class _Tp> 2334249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&> 2335227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2336227825Stheraven{ 2337227825Stheraven}; 2338227825Stheraven 2339232950Stheraven#endif // !__has_feature(is_trivially_constructible) 2340232950Stheraven 2341227825Stheraven#else // _LIBCPP_HAS_NO_VARIADICS 2342227825Stheraven 2343227825Stheraventemplate <class _Tp, class _A0 = __is_construct::__nat, 2344227825Stheraven class _A1 = __is_construct::__nat> 2345249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible 2346227825Stheraven : false_type 2347227825Stheraven{ 2348227825Stheraven}; 2349227825Stheraven 2350232950Stheraven#if __has_feature(is_trivially_constructible) 2351232950Stheraven 2352227825Stheraventemplate <class _Tp> 2353249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, __is_construct::__nat, 2354227825Stheraven __is_construct::__nat> 2355232950Stheraven : integral_constant<bool, __is_trivially_constructible(_Tp)> 2356232950Stheraven{ 2357232950Stheraven}; 2358232950Stheraven 2359232950Stheraventemplate <class _Tp> 2360249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp, 2361232950Stheraven __is_construct::__nat> 2362232950Stheraven : integral_constant<bool, __is_trivially_constructible(_Tp, _Tp)> 2363232950Stheraven{ 2364232950Stheraven}; 2365232950Stheraven 2366232950Stheraventemplate <class _Tp> 2367249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, const _Tp&, 2368232950Stheraven __is_construct::__nat> 2369232950Stheraven : integral_constant<bool, __is_trivially_constructible(_Tp, const _Tp&)> 2370232950Stheraven{ 2371232950Stheraven}; 2372232950Stheraven 2373232950Stheraventemplate <class _Tp> 2374249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&, 2375232950Stheraven __is_construct::__nat> 2376232950Stheraven : integral_constant<bool, __is_trivially_constructible(_Tp, _Tp&)> 2377232950Stheraven{ 2378232950Stheraven}; 2379232950Stheraven 2380232950Stheraven#else // !__has_feature(is_trivially_constructible) 2381232950Stheraven 2382232950Stheraventemplate <class _Tp> 2383249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, __is_construct::__nat, 2384232950Stheraven __is_construct::__nat> 2385227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2386227825Stheraven{ 2387227825Stheraven}; 2388227825Stheraven 2389227825Stheraventemplate <class _Tp> 2390249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp, 2391227825Stheraven __is_construct::__nat> 2392227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2393227825Stheraven{ 2394227825Stheraven}; 2395227825Stheraven 2396227825Stheraventemplate <class _Tp> 2397249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, const _Tp&, 2398227825Stheraven __is_construct::__nat> 2399227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2400227825Stheraven{ 2401227825Stheraven}; 2402227825Stheraven 2403227825Stheraventemplate <class _Tp> 2404249998Sdimstruct _LIBCPP_TYPE_VIS is_trivially_constructible<_Tp, _Tp&, 2405227825Stheraven __is_construct::__nat> 2406227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2407227825Stheraven{ 2408227825Stheraven}; 2409227825Stheraven 2410232950Stheraven#endif // !__has_feature(is_trivially_constructible) 2411232950Stheraven 2412227825Stheraven#endif // _LIBCPP_HAS_NO_VARIADICS 2413227825Stheraven 2414227825Stheraven// is_trivially_default_constructible 2415227825Stheraven 2416249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_default_constructible 2417227825Stheraven : public is_trivially_constructible<_Tp> 2418227825Stheraven {}; 2419227825Stheraven 2420227825Stheraven// is_trivially_copy_constructible 2421227825Stheraven 2422249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_copy_constructible 2423227825Stheraven : public is_trivially_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type> 2424227825Stheraven {}; 2425227825Stheraven 2426227825Stheraven// is_trivially_move_constructible 2427227825Stheraven 2428249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_move_constructible 2429227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2430227825Stheraven : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> 2431227825Stheraven#else 2432227825Stheraven : public is_trivially_copy_constructible<_Tp> 2433227825Stheraven#endif 2434227825Stheraven {}; 2435227825Stheraven 2436227825Stheraven// is_trivially_assignable 2437227825Stheraven 2438232950Stheraven#if __has_feature(is_trivially_constructible) 2439232950Stheraven 2440227825Stheraventemplate <class _Tp, class _Arg> 2441227825Stheravenstruct is_trivially_assignable 2442232950Stheraven : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)> 2443232950Stheraven{ 2444232950Stheraven}; 2445232950Stheraven 2446232950Stheraven#else // !__has_feature(is_trivially_constructible) 2447232950Stheraven 2448232950Stheraventemplate <class _Tp, class _Arg> 2449232950Stheravenstruct is_trivially_assignable 2450227825Stheraven : public false_type {}; 2451227825Stheraven 2452227825Stheraventemplate <class _Tp> 2453227825Stheravenstruct is_trivially_assignable<_Tp&, _Tp> 2454227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2455227825Stheraven 2456227825Stheraventemplate <class _Tp> 2457227825Stheravenstruct is_trivially_assignable<_Tp&, _Tp&> 2458227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2459227825Stheraven 2460227825Stheraventemplate <class _Tp> 2461227825Stheravenstruct is_trivially_assignable<_Tp&, const _Tp&> 2462227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2463227825Stheraven 2464227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2465227825Stheraven 2466227825Stheraventemplate <class _Tp> 2467227825Stheravenstruct is_trivially_assignable<_Tp&, _Tp&&> 2468227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2469227825Stheraven 2470227825Stheraven#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 2471227825Stheraven 2472232950Stheraven#endif // !__has_feature(is_trivially_constructible) 2473232950Stheraven 2474227825Stheraven// is_trivially_copy_assignable 2475227825Stheraven 2476249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_copy_assignable 2477227825Stheraven : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type, 2478227825Stheraven const typename add_lvalue_reference<_Tp>::type> 2479227825Stheraven {}; 2480227825Stheraven 2481227825Stheraven// is_trivially_move_assignable 2482227825Stheraven 2483249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_move_assignable 2484227825Stheraven : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type, 2485227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2486227825Stheraven typename add_rvalue_reference<_Tp>::type> 2487227825Stheraven#else 2488227825Stheraven typename add_lvalue_reference<_Tp>::type> 2489227825Stheraven#endif 2490227825Stheraven {}; 2491227825Stheraven 2492227825Stheraven// is_trivially_destructible 2493227825Stheraven 2494227825Stheraven#if __has_feature(has_trivial_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2495227825Stheraven 2496249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_destructible 2497227825Stheraven : public integral_constant<bool, __has_trivial_destructor(_Tp)> {}; 2498227825Stheraven 2499227825Stheraven#else // _LIBCPP_HAS_TYPE_TRAITS 2500227825Stheraven 2501227825Stheraventemplate <class _Tp> struct __libcpp_trivial_destructor 2502227825Stheraven : public integral_constant<bool, is_scalar<_Tp>::value || 2503227825Stheraven is_reference<_Tp>::value> {}; 2504227825Stheraven 2505249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_destructible 2506227825Stheraven : public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {}; 2507227825Stheraven 2508227825Stheraven#endif // _LIBCPP_HAS_TYPE_TRAITS 2509227825Stheraven 2510227825Stheraven// is_nothrow_constructible 2511227825Stheraven 2512227825Stheraven#ifndef _LIBCPP_HAS_NO_VARIADICS 2513227825Stheraven 2514227825Stheraven#if __has_feature(cxx_noexcept) 2515227825Stheraven 2516227825Stheraventemplate <bool, class _Tp, class... _Args> struct __is_nothrow_constructible; 2517227825Stheraven 2518227825Stheraventemplate <class _Tp, class... _Args> 2519227825Stheravenstruct __is_nothrow_constructible<true, _Tp, _Args...> 2520227825Stheraven : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))> 2521227825Stheraven{ 2522227825Stheraven}; 2523227825Stheraven 2524227825Stheraventemplate <class _Tp, class... _Args> 2525227825Stheravenstruct __is_nothrow_constructible<false, _Tp, _Args...> 2526227825Stheraven : public false_type 2527227825Stheraven{ 2528227825Stheraven}; 2529227825Stheraven 2530227825Stheraventemplate <class _Tp, class... _Args> 2531249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible 2532227825Stheraven : __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp, _Args...> 2533227825Stheraven{ 2534227825Stheraven}; 2535227825Stheraven 2536227825Stheraventemplate <class _Tp, size_t _Ns> 2537249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp[_Ns]> 2538227825Stheraven : __is_nothrow_constructible<is_constructible<_Tp>::value, _Tp> 2539227825Stheraven{ 2540227825Stheraven}; 2541227825Stheraven 2542227825Stheraven#else // __has_feature(cxx_noexcept) 2543227825Stheraven 2544227825Stheraventemplate <class _Tp, class... _Args> 2545249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible 2546227825Stheraven : false_type 2547227825Stheraven{ 2548227825Stheraven}; 2549227825Stheraven 2550227825Stheraventemplate <class _Tp> 2551249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp> 2552227825Stheraven#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2553227825Stheraven : integral_constant<bool, __has_nothrow_constructor(_Tp)> 2554227825Stheraven#else 2555227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2556227825Stheraven#endif 2557227825Stheraven{ 2558227825Stheraven}; 2559227825Stheraven 2560227825Stheraventemplate <class _Tp> 2561227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2562249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp&&> 2563227825Stheraven#else 2564249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp> 2565227825Stheraven#endif 2566227825Stheraven#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2567227825Stheraven : integral_constant<bool, __has_nothrow_copy(_Tp)> 2568227825Stheraven#else 2569227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2570227825Stheraven#endif 2571227825Stheraven{ 2572227825Stheraven}; 2573227825Stheraven 2574227825Stheraventemplate <class _Tp> 2575249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, const _Tp&> 2576227825Stheraven#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2577227825Stheraven : integral_constant<bool, __has_nothrow_copy(_Tp)> 2578227825Stheraven#else 2579227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2580227825Stheraven#endif 2581227825Stheraven{ 2582227825Stheraven}; 2583227825Stheraven 2584227825Stheraventemplate <class _Tp> 2585249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp&> 2586227825Stheraven#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2587227825Stheraven : integral_constant<bool, __has_nothrow_copy(_Tp)> 2588227825Stheraven#else 2589227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2590227825Stheraven#endif 2591227825Stheraven{ 2592227825Stheraven}; 2593227825Stheraven 2594227825Stheraven#endif // __has_feature(cxx_noexcept) 2595227825Stheraven 2596227825Stheraven#else // _LIBCPP_HAS_NO_VARIADICS 2597227825Stheraven 2598227825Stheraventemplate <class _Tp, class _A0 = __is_construct::__nat, 2599227825Stheraven class _A1 = __is_construct::__nat> 2600249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible 2601227825Stheraven : false_type 2602227825Stheraven{ 2603227825Stheraven}; 2604227825Stheraven 2605227825Stheraventemplate <class _Tp> 2606249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, __is_construct::__nat, 2607227825Stheraven __is_construct::__nat> 2608227825Stheraven#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2609227825Stheraven : integral_constant<bool, __has_nothrow_constructor(_Tp)> 2610227825Stheraven#else 2611227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2612227825Stheraven#endif 2613227825Stheraven{ 2614227825Stheraven}; 2615227825Stheraven 2616227825Stheraventemplate <class _Tp> 2617249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp, 2618227825Stheraven __is_construct::__nat> 2619227825Stheraven#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2620227825Stheraven : integral_constant<bool, __has_nothrow_copy(_Tp)> 2621227825Stheraven#else 2622227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2623227825Stheraven#endif 2624227825Stheraven{ 2625227825Stheraven}; 2626227825Stheraven 2627227825Stheraventemplate <class _Tp> 2628249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, const _Tp&, 2629227825Stheraven __is_construct::__nat> 2630227825Stheraven#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2631227825Stheraven : integral_constant<bool, __has_nothrow_copy(_Tp)> 2632227825Stheraven#else 2633227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2634227825Stheraven#endif 2635227825Stheraven{ 2636227825Stheraven}; 2637227825Stheraven 2638227825Stheraventemplate <class _Tp> 2639249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_constructible<_Tp, _Tp&, 2640227825Stheraven __is_construct::__nat> 2641227825Stheraven#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2642227825Stheraven : integral_constant<bool, __has_nothrow_copy(_Tp)> 2643227825Stheraven#else 2644227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> 2645227825Stheraven#endif 2646227825Stheraven{ 2647227825Stheraven}; 2648227825Stheraven 2649227825Stheraven#endif // _LIBCPP_HAS_NO_VARIADICS 2650227825Stheraven 2651227825Stheraven// is_nothrow_default_constructible 2652227825Stheraven 2653249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_default_constructible 2654227825Stheraven : public is_nothrow_constructible<_Tp> 2655227825Stheraven {}; 2656227825Stheraven 2657227825Stheraven// is_nothrow_copy_constructible 2658227825Stheraven 2659249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_copy_constructible 2660227825Stheraven : public is_nothrow_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type> 2661227825Stheraven {}; 2662227825Stheraven 2663227825Stheraven// is_nothrow_move_constructible 2664227825Stheraven 2665249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_move_constructible 2666227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2667227825Stheraven : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type> 2668227825Stheraven#else 2669227825Stheraven : public is_nothrow_copy_constructible<_Tp> 2670227825Stheraven#endif 2671227825Stheraven {}; 2672227825Stheraven 2673227825Stheraven// is_nothrow_assignable 2674227825Stheraven 2675227825Stheraven#if __has_feature(cxx_noexcept) 2676227825Stheraven 2677227825Stheraventemplate <bool, class _Tp, class _Arg> struct __is_nothrow_assignable; 2678227825Stheraven 2679227825Stheraventemplate <class _Tp, class _Arg> 2680227825Stheravenstruct __is_nothrow_assignable<false, _Tp, _Arg> 2681227825Stheraven : public false_type 2682227825Stheraven{ 2683227825Stheraven}; 2684227825Stheraven 2685227825Stheraventemplate <class _Tp, class _Arg> 2686227825Stheravenstruct __is_nothrow_assignable<true, _Tp, _Arg> 2687227825Stheraven : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>() = _VSTD::declval<_Arg>()) > 2688227825Stheraven{ 2689227825Stheraven}; 2690227825Stheraven 2691227825Stheraventemplate <class _Tp, class _Arg> 2692249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_assignable 2693227825Stheraven : public __is_nothrow_assignable<is_assignable<_Tp, _Arg>::value, _Tp, _Arg> 2694227825Stheraven{ 2695227825Stheraven}; 2696227825Stheraven 2697227825Stheraven#else // __has_feature(cxx_noexcept) 2698227825Stheraven 2699227825Stheraventemplate <class _Tp, class _Arg> 2700249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_assignable 2701227825Stheraven : public false_type {}; 2702227825Stheraven 2703227825Stheraventemplate <class _Tp> 2704249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_assignable<_Tp&, _Tp> 2705227825Stheraven#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2706227825Stheraven : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; 2707227825Stheraven#else 2708227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2709227825Stheraven#endif 2710227825Stheraven 2711227825Stheraventemplate <class _Tp> 2712249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_assignable<_Tp&, _Tp&> 2713227825Stheraven#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2714227825Stheraven : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; 2715227825Stheraven#else 2716227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2717227825Stheraven#endif 2718227825Stheraven 2719227825Stheraventemplate <class _Tp> 2720249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_assignable<_Tp&, const _Tp&> 2721227825Stheraven#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2722227825Stheraven : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; 2723227825Stheraven#else 2724227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2725227825Stheraven#endif 2726227825Stheraven 2727227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2728227825Stheraven 2729227825Stheraventemplate <class _Tp> 2730227825Stheravenstruct is_nothrow_assignable<_Tp&, _Tp&&> 2731227825Stheraven#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2732227825Stheraven : integral_constant<bool, __has_nothrow_assign(_Tp)> {}; 2733227825Stheraven#else 2734227825Stheraven : integral_constant<bool, is_scalar<_Tp>::value> {}; 2735227825Stheraven#endif 2736227825Stheraven 2737227825Stheraven#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES 2738227825Stheraven 2739227825Stheraven#endif // __has_feature(cxx_noexcept) 2740227825Stheraven 2741227825Stheraven// is_nothrow_copy_assignable 2742227825Stheraven 2743249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_copy_assignable 2744227825Stheraven : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type, 2745227825Stheraven const typename add_lvalue_reference<_Tp>::type> 2746227825Stheraven {}; 2747227825Stheraven 2748227825Stheraven// is_nothrow_move_assignable 2749227825Stheraven 2750249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_move_assignable 2751227825Stheraven : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type, 2752227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2753227825Stheraven typename add_rvalue_reference<_Tp>::type> 2754227825Stheraven#else 2755227825Stheraven typename add_lvalue_reference<_Tp>::type> 2756227825Stheraven#endif 2757227825Stheraven {}; 2758227825Stheraven 2759227825Stheraven// is_nothrow_destructible 2760227825Stheraven 2761227825Stheraven#if __has_feature(cxx_noexcept) 2762227825Stheraven 2763227825Stheraventemplate <bool, class _Tp> struct __is_nothrow_destructible; 2764227825Stheraven 2765227825Stheraventemplate <class _Tp> 2766227825Stheravenstruct __is_nothrow_destructible<false, _Tp> 2767227825Stheraven : public false_type 2768227825Stheraven{ 2769227825Stheraven}; 2770227825Stheraven 2771227825Stheraventemplate <class _Tp> 2772227825Stheravenstruct __is_nothrow_destructible<true, _Tp> 2773227825Stheraven : public integral_constant<bool, noexcept(_VSTD::declval<_Tp>().~_Tp()) > 2774227825Stheraven{ 2775227825Stheraven}; 2776227825Stheraven 2777227825Stheraventemplate <class _Tp> 2778249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_destructible 2779227825Stheraven : public __is_nothrow_destructible<is_destructible<_Tp>::value, _Tp> 2780227825Stheraven{ 2781227825Stheraven}; 2782227825Stheraven 2783227825Stheraventemplate <class _Tp, size_t _Ns> 2784249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_destructible<_Tp[_Ns]> 2785227825Stheraven : public is_nothrow_destructible<_Tp> 2786227825Stheraven{ 2787227825Stheraven}; 2788227825Stheraven 2789227825Stheraventemplate <class _Tp> 2790249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_destructible<_Tp&> 2791227825Stheraven : public true_type 2792227825Stheraven{ 2793227825Stheraven}; 2794227825Stheraven 2795227825Stheraven#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 2796227825Stheraven 2797227825Stheraventemplate <class _Tp> 2798249998Sdimstruct _LIBCPP_TYPE_VIS is_nothrow_destructible<_Tp&&> 2799227825Stheraven : public true_type 2800227825Stheraven{ 2801227825Stheraven}; 2802227825Stheraven 2803227825Stheraven#endif 2804227825Stheraven 2805227825Stheraven#else 2806227825Stheraven 2807227825Stheraventemplate <class _Tp> struct __libcpp_nothrow_destructor 2808227825Stheraven : public integral_constant<bool, is_scalar<_Tp>::value || 2809227825Stheraven is_reference<_Tp>::value> {}; 2810227825Stheraven 2811249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_nothrow_destructible 2812227825Stheraven : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {}; 2813227825Stheraven 2814227825Stheraven#endif 2815227825Stheraven 2816227825Stheraven// is_pod 2817227825Stheraven 2818227825Stheraven#if __has_feature(is_pod) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3) 2819227825Stheraven 2820249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_pod 2821227825Stheraven : public integral_constant<bool, __is_pod(_Tp)> {}; 2822227825Stheraven 2823227825Stheraven#else // _LIBCPP_HAS_TYPE_TRAITS 2824227825Stheraven 2825249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_pod 2826227825Stheraven : public integral_constant<bool, is_trivially_default_constructible<_Tp>::value && 2827227825Stheraven is_trivially_copy_constructible<_Tp>::value && 2828227825Stheraven is_trivially_copy_assignable<_Tp>::value && 2829227825Stheraven is_trivially_destructible<_Tp>::value> {}; 2830227825Stheraven 2831227825Stheraven#endif // _LIBCPP_HAS_TYPE_TRAITS 2832227825Stheraven 2833227825Stheraven// is_literal_type; 2834227825Stheraven 2835249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_literal_type 2836227825Stheraven#if __has_feature(is_literal) 2837227825Stheraven : public integral_constant<bool, __is_literal(_Tp)> 2838227825Stheraven#else 2839227825Stheraven : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value || 2840227825Stheraven is_reference<typename remove_all_extents<_Tp>::type>::value> 2841227825Stheraven#endif 2842227825Stheraven {}; 2843227825Stheraven 2844227825Stheraven// is_standard_layout; 2845227825Stheraven 2846249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_standard_layout 2847227825Stheraven#if __has_feature(is_standard_layout) 2848227825Stheraven : public integral_constant<bool, __is_standard_layout(_Tp)> 2849227825Stheraven#else 2850227825Stheraven : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value> 2851227825Stheraven#endif 2852227825Stheraven {}; 2853227825Stheraven 2854227825Stheraven// is_trivially_copyable; 2855227825Stheraven 2856249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivially_copyable 2857227825Stheraven#if __has_feature(is_trivially_copyable) 2858227825Stheraven : public integral_constant<bool, __is_trivially_copyable(_Tp)> 2859227825Stheraven#else 2860227825Stheraven : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value> 2861227825Stheraven#endif 2862227825Stheraven {}; 2863227825Stheraven 2864227825Stheraven// is_trivial; 2865227825Stheraven 2866249998Sdimtemplate <class _Tp> struct _LIBCPP_TYPE_VIS is_trivial 2867227825Stheraven#if __has_feature(is_trivial) 2868227825Stheraven : public integral_constant<bool, __is_trivial(_Tp)> 2869227825Stheraven#else 2870227825Stheraven : integral_constant<bool, is_trivially_copyable<_Tp>::value && 2871227825Stheraven is_trivially_default_constructible<_Tp>::value> 2872227825Stheraven#endif 2873227825Stheraven {}; 2874227825Stheraven 2875227825Stheraven#ifndef _LIBCPP_HAS_NO_VARIADICS 2876227825Stheraven 2877227825Stheraven// Check for complete types 2878227825Stheraven 2879232950Stheraventemplate <class ..._Tp> struct __check_complete; 2880227825Stheraven 2881227825Stheraventemplate <> 2882227825Stheravenstruct __check_complete<> 2883227825Stheraven{ 2884227825Stheraven}; 2885227825Stheraven 2886232950Stheraventemplate <class _Hp, class _T0, class ..._Tp> 2887232950Stheravenstruct __check_complete<_Hp, _T0, _Tp...> 2888232950Stheraven : private __check_complete<_Hp>, 2889232950Stheraven private __check_complete<_T0, _Tp...> 2890227825Stheraven{ 2891227825Stheraven}; 2892227825Stheraven 2893232950Stheraventemplate <class _Hp> 2894232950Stheravenstruct __check_complete<_Hp, _Hp> 2895232950Stheraven : private __check_complete<_Hp> 2896227825Stheraven{ 2897227825Stheraven}; 2898227825Stheraven 2899232950Stheraventemplate <class _Tp> 2900232950Stheravenstruct __check_complete<_Tp> 2901227825Stheraven{ 2902232950Stheraven static_assert(sizeof(_Tp) > 0, "Type must be complete."); 2903227825Stheraven}; 2904227825Stheraven 2905232950Stheraventemplate <class _Tp> 2906232950Stheravenstruct __check_complete<_Tp&> 2907232950Stheraven : private __check_complete<_Tp> 2908227825Stheraven{ 2909227825Stheraven}; 2910227825Stheraven 2911232950Stheraventemplate <class _Tp> 2912232950Stheravenstruct __check_complete<_Tp&&> 2913232950Stheraven : private __check_complete<_Tp> 2914227825Stheraven{ 2915227825Stheraven}; 2916227825Stheraven 2917232950Stheraventemplate <class _Rp, class ..._Param> 2918232950Stheravenstruct __check_complete<_Rp (*)(_Param...)> 2919241903Sdim : private __check_complete<_Rp> 2920227825Stheraven{ 2921227825Stheraven}; 2922227825Stheraven 2923232950Stheraventemplate <class _Rp, class ..._Param> 2924232950Stheravenstruct __check_complete<_Rp (_Param...)> 2925241903Sdim : private __check_complete<_Rp> 2926227825Stheraven{ 2927227825Stheraven}; 2928227825Stheraven 2929232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2930232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...)> 2931241903Sdim : private __check_complete<_Class> 2932227825Stheraven{ 2933227825Stheraven}; 2934227825Stheraven 2935232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2936232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) const> 2937241903Sdim : private __check_complete<_Class> 2938227825Stheraven{ 2939227825Stheraven}; 2940227825Stheraven 2941232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2942232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) volatile> 2943241903Sdim : private __check_complete<_Class> 2944227825Stheraven{ 2945227825Stheraven}; 2946227825Stheraven 2947232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2948232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) const volatile> 2949241903Sdim : private __check_complete<_Class> 2950227825Stheraven{ 2951227825Stheraven}; 2952227825Stheraven 2953227825Stheraven#if __has_feature(cxx_reference_qualified_functions) 2954227825Stheraven 2955232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2956232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) &> 2957241903Sdim : private __check_complete<_Class> 2958227825Stheraven{ 2959227825Stheraven}; 2960227825Stheraven 2961232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2962232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) const&> 2963241903Sdim : private __check_complete<_Class> 2964227825Stheraven{ 2965227825Stheraven}; 2966227825Stheraven 2967232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2968232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) volatile&> 2969241903Sdim : private __check_complete<_Class> 2970227825Stheraven{ 2971227825Stheraven}; 2972227825Stheraven 2973232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2974232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) const volatile&> 2975241903Sdim : private __check_complete<_Class> 2976227825Stheraven{ 2977227825Stheraven}; 2978227825Stheraven 2979232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2980232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) &&> 2981241903Sdim : private __check_complete<_Class> 2982227825Stheraven{ 2983227825Stheraven}; 2984227825Stheraven 2985232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2986232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) const&&> 2987241903Sdim : private __check_complete<_Class> 2988227825Stheraven{ 2989227825Stheraven}; 2990227825Stheraven 2991232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2992232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) volatile&&> 2993241903Sdim : private __check_complete<_Class> 2994227825Stheraven{ 2995227825Stheraven}; 2996227825Stheraven 2997232950Stheraventemplate <class _Rp, class _Class, class ..._Param> 2998232950Stheravenstruct __check_complete<_Rp (_Class::*)(_Param...) const volatile&&> 2999241903Sdim : private __check_complete<_Class> 3000227825Stheraven{ 3001227825Stheraven}; 3002227825Stheraven 3003227825Stheraven#endif 3004227825Stheraven 3005232950Stheraventemplate <class _Rp, class _Class> 3006232950Stheravenstruct __check_complete<_Rp _Class::*> 3007227825Stheraven : private __check_complete<_Class> 3008227825Stheraven{ 3009227825Stheraven}; 3010227825Stheraven 3011227825Stheraven// __invoke forward declarations 3012227825Stheraven 3013227825Stheraven// fall back - none of the bullets 3014227825Stheraven 3015227825Stheraventemplate <class ..._Args> 3016227825Stheravenauto 3017227825Stheraven__invoke(__any, _Args&& ...__args) 3018227825Stheraven -> __nat; 3019227825Stheraven 3020227825Stheraven// bullets 1 and 2 3021227825Stheraven 3022253159Stheraventemplate <class _Fp, class _A0, class ..._Args, 3023253159Stheraven class = typename enable_if 3024253159Stheraven < 3025253159Stheraven is_member_function_pointer<typename remove_reference<_Fp>::type>::value && 3026253159Stheraven is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType, 3027253159Stheraven typename remove_reference<_A0>::type>::value 3028253159Stheraven >::type 3029253159Stheraven > 3030241903Sdim_LIBCPP_INLINE_VISIBILITY 3031227825Stheravenauto 3032232950Stheraven__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) 3033227825Stheraven -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...)); 3034227825Stheraven 3035253159Stheraventemplate <class _Fp, class _A0, class ..._Args, 3036253159Stheraven class = typename enable_if 3037253159Stheraven < 3038253159Stheraven is_member_function_pointer<typename remove_reference<_Fp>::type>::value && 3039253159Stheraven !is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType, 3040253159Stheraven typename remove_reference<_A0>::type>::value 3041253159Stheraven >::type 3042253159Stheraven > 3043241903Sdim_LIBCPP_INLINE_VISIBILITY 3044227825Stheravenauto 3045232950Stheraven__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args) 3046227825Stheraven -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...)); 3047227825Stheraven 3048227825Stheraven// bullets 3 and 4 3049227825Stheraven 3050253159Stheraventemplate <class _Fp, class _A0, 3051253159Stheraven class = typename enable_if 3052253159Stheraven < 3053253159Stheraven is_member_object_pointer<typename remove_reference<_Fp>::type>::value && 3054253159Stheraven is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType, 3055253159Stheraven typename remove_reference<_A0>::type>::value 3056253159Stheraven >::type 3057253159Stheraven > 3058241903Sdim_LIBCPP_INLINE_VISIBILITY 3059227825Stheravenauto 3060232950Stheraven__invoke(_Fp&& __f, _A0&& __a0) 3061227825Stheraven -> decltype(_VSTD::forward<_A0>(__a0).*__f); 3062227825Stheraven 3063253159Stheraventemplate <class _Fp, class _A0, 3064253159Stheraven class = typename enable_if 3065253159Stheraven < 3066253159Stheraven is_member_object_pointer<typename remove_reference<_Fp>::type>::value && 3067253159Stheraven !is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType, 3068253159Stheraven typename remove_reference<_A0>::type>::value 3069253159Stheraven >::type 3070253159Stheraven > 3071241903Sdim_LIBCPP_INLINE_VISIBILITY 3072227825Stheravenauto 3073232950Stheraven__invoke(_Fp&& __f, _A0&& __a0) 3074227825Stheraven -> decltype((*_VSTD::forward<_A0>(__a0)).*__f); 3075227825Stheraven 3076227825Stheraven// bullet 5 3077227825Stheraven 3078232950Stheraventemplate <class _Fp, class ..._Args> 3079241903Sdim_LIBCPP_INLINE_VISIBILITY 3080227825Stheravenauto 3081232950Stheraven__invoke(_Fp&& __f, _Args&& ...__args) 3082232950Stheraven -> decltype(_VSTD::forward<_Fp>(__f)(_VSTD::forward<_Args>(__args)...)); 3083227825Stheraven 3084227825Stheraven// __invokable 3085227825Stheraven 3086232950Stheraventemplate <class _Fp, class ..._Args> 3087227825Stheravenstruct __invokable_imp 3088241903Sdim : private __check_complete<_Fp> 3089227825Stheraven{ 3090227825Stheraven typedef decltype( 3091232950Stheraven __invoke(_VSTD::declval<_Fp>(), _VSTD::declval<_Args>()...) 3092227825Stheraven ) type; 3093227825Stheraven static const bool value = !is_same<type, __nat>::value; 3094227825Stheraven}; 3095227825Stheraven 3096232950Stheraventemplate <class _Fp, class ..._Args> 3097227825Stheravenstruct __invokable 3098227825Stheraven : public integral_constant<bool, 3099232950Stheraven __invokable_imp<_Fp, _Args...>::value> 3100227825Stheraven{ 3101227825Stheraven}; 3102227825Stheraven 3103227825Stheraven// __invoke_of 3104227825Stheraven 3105232950Stheraventemplate <bool _Invokable, class _Fp, class ..._Args> 3106227825Stheravenstruct __invoke_of_imp // false 3107227825Stheraven{ 3108227825Stheraven}; 3109227825Stheraven 3110232950Stheraventemplate <class _Fp, class ..._Args> 3111232950Stheravenstruct __invoke_of_imp<true, _Fp, _Args...> 3112227825Stheraven{ 3113232950Stheraven typedef typename __invokable_imp<_Fp, _Args...>::type type; 3114227825Stheraven}; 3115227825Stheraven 3116232950Stheraventemplate <class _Fp, class ..._Args> 3117227825Stheravenstruct __invoke_of 3118232950Stheraven : public __invoke_of_imp<__invokable<_Fp, _Args...>::value, _Fp, _Args...> 3119227825Stheraven{ 3120227825Stheraven}; 3121227825Stheraven 3122241903Sdimtemplate <class _Fp, class ..._Args> 3123249998Sdimclass _LIBCPP_TYPE_VIS result_of<_Fp(_Args...)> 3124241903Sdim : public __invoke_of<_Fp, _Args...> 3125241903Sdim{ 3126241903Sdim}; 3127241903Sdim 3128253159Stheraven#if _LIBCPP_STD_VER > 11 3129253159Stheraventemplate <class _Tp> using result_of_t = typename result_of<_Tp>::type; 3130253159Stheraven#endif 3131253159Stheraven 3132227825Stheraven#endif // _LIBCPP_HAS_NO_VARIADICS 3133227825Stheraven 3134227825Stheraventemplate <class _Tp> 3135227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 3136227825Stheraven#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE 3137227825Stheraventypename enable_if 3138227825Stheraven< 3139227825Stheraven is_move_constructible<_Tp>::value && 3140227825Stheraven is_move_assignable<_Tp>::value 3141227825Stheraven>::type 3142227825Stheraven#else 3143227825Stheravenvoid 3144227825Stheraven#endif 3145227825Stheravenswap(_Tp& __x, _Tp& __y) _NOEXCEPT_(is_nothrow_move_constructible<_Tp>::value && 3146227825Stheraven is_nothrow_move_assignable<_Tp>::value) 3147227825Stheraven{ 3148227825Stheraven _Tp __t(_VSTD::move(__x)); 3149227825Stheraven __x = _VSTD::move(__y); 3150227825Stheraven __y = _VSTD::move(__t); 3151227825Stheraven} 3152227825Stheraven 3153227825Stheraventemplate <class _ForwardIterator1, class _ForwardIterator2> 3154227825Stheraveninline _LIBCPP_INLINE_VISIBILITY 3155227825Stheravenvoid 3156227825Stheraveniter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b) 3157227825Stheraven // _NOEXCEPT_(_NOEXCEPT_(swap(*__a, *__b))) 3158227825Stheraven _NOEXCEPT_(_NOEXCEPT_(swap(*_VSTD::declval<_ForwardIterator1>(), 3159227825Stheraven *_VSTD::declval<_ForwardIterator2>()))) 3160227825Stheraven{ 3161227825Stheraven swap(*__a, *__b); 3162227825Stheraven} 3163227825Stheraven 3164227825Stheraven// __swappable 3165227825Stheraven 3166227825Stheravennamespace __detail 3167227825Stheraven{ 3168227825Stheraven 3169227825Stheravenusing _VSTD::swap; 3170227825Stheraven__nat swap(__any, __any); 3171227825Stheraven 3172227825Stheraventemplate <class _Tp> 3173227825Stheravenstruct __swappable 3174227825Stheraven{ 3175227825Stheraven typedef decltype(swap(_VSTD::declval<_Tp&>(), _VSTD::declval<_Tp&>())) type; 3176227825Stheraven static const bool value = !is_same<type, __nat>::value; 3177227825Stheraven}; 3178227825Stheraven 3179227825Stheraven} // __detail 3180227825Stheraven 3181227825Stheraventemplate <class _Tp> 3182227825Stheravenstruct __is_swappable 3183227825Stheraven : public integral_constant<bool, __detail::__swappable<_Tp>::value> 3184227825Stheraven{ 3185227825Stheraven}; 3186227825Stheraven 3187227825Stheraven#if __has_feature(cxx_noexcept) 3188227825Stheraven 3189227825Stheraventemplate <bool, class _Tp> 3190227825Stheravenstruct __is_nothrow_swappable_imp 3191227825Stheraven : public integral_constant<bool, noexcept(swap(_VSTD::declval<_Tp&>(), 3192227825Stheraven _VSTD::declval<_Tp&>()))> 3193227825Stheraven{ 3194227825Stheraven}; 3195227825Stheraven 3196227825Stheraventemplate <class _Tp> 3197227825Stheravenstruct __is_nothrow_swappable_imp<false, _Tp> 3198227825Stheraven : public false_type 3199227825Stheraven{ 3200227825Stheraven}; 3201227825Stheraven 3202227825Stheraventemplate <class _Tp> 3203227825Stheravenstruct __is_nothrow_swappable 3204227825Stheraven : public __is_nothrow_swappable_imp<__is_swappable<_Tp>::value, _Tp> 3205227825Stheraven{ 3206227825Stheraven}; 3207227825Stheraven 3208227825Stheraven#else // __has_feature(cxx_noexcept) 3209227825Stheraven 3210227825Stheraventemplate <class _Tp> 3211227825Stheravenstruct __is_nothrow_swappable 3212227825Stheraven : public false_type 3213227825Stheraven{ 3214227825Stheraven}; 3215227825Stheraven 3216227825Stheraven#endif // __has_feature(cxx_noexcept) 3217227825Stheraven 3218227825Stheraven#ifdef _LIBCXX_UNDERLYING_TYPE 3219227825Stheraven 3220227825Stheraventemplate <class _Tp> 3221227825Stheravenstruct underlying_type 3222227825Stheraven{ 3223227825Stheraven typedef _LIBCXX_UNDERLYING_TYPE(_Tp) type; 3224227825Stheraven}; 3225227825Stheraven 3226253159Stheraven#if _LIBCPP_STD_VER > 11 3227253159Stheraventemplate <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type; 3228253159Stheraven#endif 3229253159Stheraven 3230227825Stheraven#else // _LIBCXX_UNDERLYING_TYPE 3231227825Stheraven 3232227825Stheraventemplate <class _Tp, bool _Support = false> 3233227825Stheravenstruct underlying_type 3234227825Stheraven{ 3235227825Stheraven static_assert(_Support, "The underyling_type trait requires compiler " 3236227825Stheraven "support. Either no such support exists or " 3237227825Stheraven "libc++ does not know how to use it."); 3238227825Stheraven}; 3239227825Stheraven 3240227825Stheraven#endif // _LIBCXX_UNDERLYING_TYPE 3241227825Stheraven 3242227825Stheraven_LIBCPP_END_NAMESPACE_STD 3243227825Stheraven 3244227825Stheraven#endif // _LIBCPP_TYPE_TRAITS 3245