Deleted Added
full compact
type_traits (276517) type_traits (277217)
1// -*- C++ -*-
2//===------------------------ type_traits ---------------------------------===//
3//
4// The LLVM Compiler Infrastructure
5//
6// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
8//

--- 77 unchanged lines hidden (view full) ---

86 template <class T> struct is_pod;
87 template <class T> struct is_trivial;
88 template <class T> struct is_trivially_copyable;
89 template <class T> struct is_standard_layout;
90 template <class T> struct is_literal_type;
91 template <class T> struct is_empty;
92 template <class T> struct is_polymorphic;
93 template <class T> struct is_abstract;
1// -*- C++ -*-
2//===------------------------ type_traits ---------------------------------===//
3//
4// The LLVM Compiler Infrastructure
5//
6// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
8//

--- 77 unchanged lines hidden (view full) ---

86 template <class T> struct is_pod;
87 template <class T> struct is_trivial;
88 template <class T> struct is_trivially_copyable;
89 template <class T> struct is_standard_layout;
90 template <class T> struct is_literal_type;
91 template <class T> struct is_empty;
92 template <class T> struct is_polymorphic;
93 template <class T> struct is_abstract;
94 template <class T> struct is_final; // C++14
94
95 template <class T, class... Args> struct is_constructible;
96 template <class T> struct is_default_constructible;
97 template <class T> struct is_copy_constructible;
98 template <class T> struct is_move_constructible;
99 template <class T, class U> struct is_assignable;
100 template <class T> struct is_copy_assignable;
101 template <class T> struct is_move_assignable;

--- 89 unchanged lines hidden (view full) ---

191 using conditional_t = typename conditional<b,T,F>::type; // C++14
192 template <class... T>
193 using common_type_t = typename common_type<T...>::type; // C++14
194 template <class T>
195 using underlying_type_t = typename underlying_type<T>::type; // C++14
196 template <class F, class... ArgTypes>
197 using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14
198
95
96 template <class T, class... Args> struct is_constructible;
97 template <class T> struct is_default_constructible;
98 template <class T> struct is_copy_constructible;
99 template <class T> struct is_move_constructible;
100 template <class T, class U> struct is_assignable;
101 template <class T> struct is_copy_assignable;
102 template <class T> struct is_move_assignable;

--- 89 unchanged lines hidden (view full) ---

192 using conditional_t = typename conditional<b,T,F>::type; // C++14
193 template <class... T>
194 using common_type_t = typename common_type<T...>::type; // C++14
195 template <class T>
196 using underlying_type_t = typename underlying_type<T>::type; // C++14
197 template <class F, class... ArgTypes>
198 using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14
199
199} // std
200 template <class...>
201 using void_t = void;
202} // C++17
200
201*/
202#include <__config>
203#include <cstddef>
204
205#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
206#pragma GCC system_header
207#endif
208
209_LIBCPP_BEGIN_NAMESPACE_STD
210
203
204*/
205#include <__config>
206#include <cstddef>
207
208#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
209#pragma GCC system_header
210#endif
211
212_LIBCPP_BEGIN_NAMESPACE_STD
213
214#ifndef _LIBCPP_HAS_NO_VARIADICS
215template <class...>
216struct __void_t { typedef void type; };
217#endif
218
211template <bool _Bp, class _If, class _Then>
212 struct _LIBCPP_TYPE_VIS_ONLY conditional {typedef _If type;};
213template <class _If, class _Then>
214 struct _LIBCPP_TYPE_VIS_ONLY conditional<false, _If, _Then> {typedef _Then type;};
215
216#if _LIBCPP_STD_VER > 11
217template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type;
218#endif
219
219template <bool _Bp, class _If, class _Then>
220 struct _LIBCPP_TYPE_VIS_ONLY conditional {typedef _If type;};
221template <class _If, class _Then>
222 struct _LIBCPP_TYPE_VIS_ONLY conditional<false, _If, _Then> {typedef _Then type;};
223
224#if _LIBCPP_STD_VER > 11
225template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type;
226#endif
227
228template <bool, class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __lazy_enable_if {};
229template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __lazy_enable_if<true, _Tp> {typedef typename _Tp::type type;};
230
220template <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS_ONLY enable_if {};
221template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY enable_if<true, _Tp> {typedef _Tp type;};
222
223#if _LIBCPP_STD_VER > 11
224template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
225#endif
226
227
228struct __two {char __lx[2];};
229
230// helper class:
231
232template <class _Tp, _Tp __v>
233struct _LIBCPP_TYPE_VIS_ONLY integral_constant
234{
235 static _LIBCPP_CONSTEXPR const _Tp value = __v;
236 typedef _Tp value_type;
237 typedef integral_constant type;
238 _LIBCPP_INLINE_VISIBILITY
231template <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS_ONLY enable_if {};
232template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY enable_if<true, _Tp> {typedef _Tp type;};
233
234#if _LIBCPP_STD_VER > 11
235template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
236#endif
237
238
239struct __two {char __lx[2];};
240
241// helper class:
242
243template <class _Tp, _Tp __v>
244struct _LIBCPP_TYPE_VIS_ONLY integral_constant
245{
246 static _LIBCPP_CONSTEXPR const _Tp value = __v;
247 typedef _Tp value_type;
248 typedef integral_constant type;
249 _LIBCPP_INLINE_VISIBILITY
239 _LIBCPP_CONSTEXPR operator value_type() const {return value;}
250 _LIBCPP_CONSTEXPR operator value_type() const _NOEXCEPT {return value;}
240#if _LIBCPP_STD_VER > 11
241 _LIBCPP_INLINE_VISIBILITY
251#if _LIBCPP_STD_VER > 11
252 _LIBCPP_INLINE_VISIBILITY
242 constexpr value_type operator ()() const {return value;}
253 constexpr value_type operator ()() const _NOEXCEPT {return value;}
243#endif
244};
245
246template <class _Tp, _Tp __v>
247_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
248
249typedef integral_constant<bool, true> true_type;
250typedef integral_constant<bool, false> false_type;

--- 37 unchanged lines hidden (view full) ---

288template <class _Tp> struct __libcpp_is_void : public false_type {};
289template <> struct __libcpp_is_void<void> : public true_type {};
290
291template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_void
292 : public __libcpp_is_void<typename remove_cv<_Tp>::type> {};
293
294// __is_nullptr_t
295
254#endif
255};
256
257template <class _Tp, _Tp __v>
258_LIBCPP_CONSTEXPR const _Tp integral_constant<_Tp, __v>::value;
259
260typedef integral_constant<bool, true> true_type;
261typedef integral_constant<bool, false> false_type;

--- 37 unchanged lines hidden (view full) ---

299template <class _Tp> struct __libcpp_is_void : public false_type {};
300template <> struct __libcpp_is_void<void> : public true_type {};
301
302template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_void
303 : public __libcpp_is_void<typename remove_cv<_Tp>::type> {};
304
305// __is_nullptr_t
306
296template <class _Tp> struct __libcpp___is_nullptr : public false_type {};
297template <> struct __libcpp___is_nullptr<nullptr_t> : public true_type {};
307template <class _Tp> struct __is_nullptr_t_impl : public false_type {};
308template <> struct __is_nullptr_t_impl<nullptr_t> : public true_type {};
298
299template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __is_nullptr_t
309
310template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY __is_nullptr_t
300 : public __libcpp___is_nullptr<typename remove_cv<_Tp>::type> {};
311 : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
301
302#if _LIBCPP_STD_VER > 11
303template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_null_pointer
312
313#if _LIBCPP_STD_VER > 11
314template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_null_pointer
304 : public __libcpp___is_nullptr<typename remove_cv<_Tp>::type> {};
315 : public __is_nullptr_t_impl<typename remove_cv<_Tp>::type> {};
305#endif
306
307// is_integral
308
309template <class _Tp> struct __libcpp_is_integral : public false_type {};
310template <> struct __libcpp_is_integral<bool> : public true_type {};
311template <> struct __libcpp_is_integral<char> : public true_type {};
312template <> struct __libcpp_is_integral<signed char> : public true_type {};

--- 6 unchanged lines hidden (view full) ---

319template <> struct __libcpp_is_integral<short> : public true_type {};
320template <> struct __libcpp_is_integral<unsigned short> : public true_type {};
321template <> struct __libcpp_is_integral<int> : public true_type {};
322template <> struct __libcpp_is_integral<unsigned int> : public true_type {};
323template <> struct __libcpp_is_integral<long> : public true_type {};
324template <> struct __libcpp_is_integral<unsigned long> : public true_type {};
325template <> struct __libcpp_is_integral<long long> : public true_type {};
326template <> struct __libcpp_is_integral<unsigned long long> : public true_type {};
316#endif
317
318// is_integral
319
320template <class _Tp> struct __libcpp_is_integral : public false_type {};
321template <> struct __libcpp_is_integral<bool> : public true_type {};
322template <> struct __libcpp_is_integral<char> : public true_type {};
323template <> struct __libcpp_is_integral<signed char> : public true_type {};

--- 6 unchanged lines hidden (view full) ---

330template <> struct __libcpp_is_integral<short> : public true_type {};
331template <> struct __libcpp_is_integral<unsigned short> : public true_type {};
332template <> struct __libcpp_is_integral<int> : public true_type {};
333template <> struct __libcpp_is_integral<unsigned int> : public true_type {};
334template <> struct __libcpp_is_integral<long> : public true_type {};
335template <> struct __libcpp_is_integral<unsigned long> : public true_type {};
336template <> struct __libcpp_is_integral<long long> : public true_type {};
337template <> struct __libcpp_is_integral<unsigned long long> : public true_type {};
338#ifndef _LIBCPP_HAS_NO_INT128
339template <> struct __libcpp_is_integral<__int128_t> : public true_type {};
340template <> struct __libcpp_is_integral<__uint128_t> : public true_type {};
341#endif
327
328template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_integral
329 : public __libcpp_is_integral<typename remove_cv<_Tp>::type> {};
330
331// is_floating_point
332
333template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
334template <> struct __libcpp_is_floating_point<float> : public true_type {};

--- 31 unchanged lines hidden (view full) ---

366#endif
367
368template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference : public false_type {};
369template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&> : public true_type {};
370#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
371template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&&> : public true_type {};
372#endif
373
342
343template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_integral
344 : public __libcpp_is_integral<typename remove_cv<_Tp>::type> {};
345
346// is_floating_point
347
348template <class _Tp> struct __libcpp_is_floating_point : public false_type {};
349template <> struct __libcpp_is_floating_point<float> : public true_type {};

--- 31 unchanged lines hidden (view full) ---

381#endif
382
383template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference : public false_type {};
384template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&> : public true_type {};
385#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
386template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&&> : public true_type {};
387#endif
388
374#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
375#define _LIBCPP_HAS_TYPE_TRAITS
376#endif
377
378// is_union
379
389// is_union
390
380#if __has_feature(is_union) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
391#if __has_feature(is_union) || (_GNUC_VER >= 403)
381
382template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
383 : public integral_constant<bool, __is_union(_Tp)> {};
384
385#else
386
387template <class _Tp> struct __libcpp_union : public false_type {};
388template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
389 : public __libcpp_union<typename remove_cv<_Tp>::type> {};
390
391#endif
392
393// is_class
394
392
393template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
394 : public integral_constant<bool, __is_union(_Tp)> {};
395
396#else
397
398template <class _Tp> struct __libcpp_union : public false_type {};
399template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
400 : public __libcpp_union<typename remove_cv<_Tp>::type> {};
401
402#endif
403
404// is_class
405
395#if __has_feature(is_class) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
406#if __has_feature(is_class) || (_GNUC_VER >= 403)
396
397template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
398 : public integral_constant<bool, __is_class(_Tp)> {};
399
400#else
401
402namespace __is_class_imp
403{

--- 8 unchanged lines hidden (view full) ---

412
413// is_same
414
415template <class _Tp, class _Up> struct _LIBCPP_TYPE_VIS_ONLY is_same : public false_type {};
416template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_same<_Tp, _Tp> : public true_type {};
417
418// is_function
419
407
408template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
409 : public integral_constant<bool, __is_class(_Tp)> {};
410
411#else
412
413namespace __is_class_imp
414{

--- 8 unchanged lines hidden (view full) ---

423
424// is_same
425
426template <class _Tp, class _Up> struct _LIBCPP_TYPE_VIS_ONLY is_same : public false_type {};
427template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_same<_Tp, _Tp> : public true_type {};
428
429// is_function
430
420namespace __is_function_imp
431namespace __libcpp_is_function_imp
421{
422template <class _Tp> char __test(_Tp*);
423template <class _Tp> __two __test(...);
424template <class _Tp> _Tp& __source();
425}
426
427template <class _Tp, bool = is_class<_Tp>::value ||
428 is_union<_Tp>::value ||
429 is_void<_Tp>::value ||
430 is_reference<_Tp>::value ||
431 __is_nullptr_t<_Tp>::value >
432struct __libcpp_is_function
432{
433template <class _Tp> char __test(_Tp*);
434template <class _Tp> __two __test(...);
435template <class _Tp> _Tp& __source();
436}
437
438template <class _Tp, bool = is_class<_Tp>::value ||
439 is_union<_Tp>::value ||
440 is_void<_Tp>::value ||
441 is_reference<_Tp>::value ||
442 __is_nullptr_t<_Tp>::value >
443struct __libcpp_is_function
433 : public integral_constant<bool, sizeof(__is_function_imp::__test<_Tp>(__is_function_imp::__source<_Tp>())) == 1>
444 : public integral_constant<bool, sizeof(__libcpp_is_function_imp::__test<_Tp>(__libcpp_is_function_imp::__source<_Tp>())) == 1>
434 {};
435template <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type {};
436
437template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_function
438 : public __libcpp_is_function<_Tp> {};
439
440// is_member_function_pointer
441
442// template <class _Tp> struct __libcpp_is_member_function_pointer : public false_type {};
443// template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
444//
445
446template <class _MP, bool _IsMemberFuctionPtr, bool _IsMemberObjectPtr>
447struct __member_pointer_traits_imp
448{ // forward declaration; specializations later
449};
450
451
452namespace __libcpp_is_member_function_pointer_imp {
445 {};
446template <class _Tp> struct __libcpp_is_function<_Tp, true> : public false_type {};
447
448template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_function
449 : public __libcpp_is_function<_Tp> {};
450
451// is_member_function_pointer
452
453// template <class _Tp> struct __libcpp_is_member_function_pointer : public false_type {};
454// template <class _Tp, class _Up> struct __libcpp_is_member_function_pointer<_Tp _Up::*> : public is_function<_Tp> {};
455//
456
457template <class _MP, bool _IsMemberFuctionPtr, bool _IsMemberObjectPtr>
458struct __member_pointer_traits_imp
459{ // forward declaration; specializations later
460};
461
462
463namespace __libcpp_is_member_function_pointer_imp {
453 template <typename _Tp>
454 char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *);
464 template <typename _Tp>
465 char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *);
455
466
456 template <typename>
457 std::__two __test(...);
467 template <typename>
468 std::__two __test(...);
458};
469};
459
470
460template <class _Tp> struct __libcpp_is_member_function_pointer
461 : public integral_constant<bool, sizeof(__libcpp_is_member_function_pointer_imp::__test<_Tp>(nullptr)) == 1> {};
462
463template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer
464 : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {};
465
466// is_member_pointer
467

--- 6 unchanged lines hidden (view full) ---

474// is_member_object_pointer
475
476template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_object_pointer
477 : public integral_constant<bool, is_member_pointer<_Tp>::value &&
478 !is_member_function_pointer<_Tp>::value> {};
479
480// is_enum
481
471template <class _Tp> struct __libcpp_is_member_function_pointer
472 : public integral_constant<bool, sizeof(__libcpp_is_member_function_pointer_imp::__test<_Tp>(nullptr)) == 1> {};
473
474template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_function_pointer
475 : public __libcpp_is_member_function_pointer<typename remove_cv<_Tp>::type> {};
476
477// is_member_pointer
478

--- 6 unchanged lines hidden (view full) ---

485// is_member_object_pointer
486
487template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_member_object_pointer
488 : public integral_constant<bool, is_member_pointer<_Tp>::value &&
489 !is_member_function_pointer<_Tp>::value> {};
490
491// is_enum
492
482#if __has_feature(is_enum) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
493#if __has_feature(is_enum) || (_GNUC_VER >= 403)
483
484template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
485 : public integral_constant<bool, __is_enum(_Tp)> {};
486
487#else
488
489template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
490 : public integral_constant<bool, !is_void<_Tp>::value &&

--- 166 unchanged lines hidden (view full) ---

657
658#if _LIBCPP_STD_VER > 11
659template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
660#endif
661
662// is_signed
663
664template <class _Tp, bool = is_integral<_Tp>::value>
494
495template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
496 : public integral_constant<bool, __is_enum(_Tp)> {};
497
498#else
499
500template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
501 : public integral_constant<bool, !is_void<_Tp>::value &&

--- 166 unchanged lines hidden (view full) ---

668
669#if _LIBCPP_STD_VER > 11
670template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
671#endif
672
673// is_signed
674
675template <class _Tp, bool = is_integral<_Tp>::value>
665struct ___is_signed : public integral_constant<bool, _Tp(-1) < _Tp(0)> {};
676struct __libcpp_is_signed_impl : public integral_constant<bool, _Tp(-1) < _Tp(0)> {};
666
667template <class _Tp>
677
678template <class _Tp>
668struct ___is_signed<_Tp, false> : public true_type {}; // floating point
679struct __libcpp_is_signed_impl<_Tp, false> : public true_type {}; // floating point
669
670template <class _Tp, bool = is_arithmetic<_Tp>::value>
680
681template <class _Tp, bool = is_arithmetic<_Tp>::value>
671struct __libcpp_is_signed : public ___is_signed<_Tp> {};
682struct __libcpp_is_signed : public __libcpp_is_signed_impl<_Tp> {};
672
673template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};
674
675template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_signed : public __libcpp_is_signed<_Tp> {};
676
677// is_unsigned
678
679template <class _Tp, bool = is_integral<_Tp>::value>
683
684template <class _Tp> struct __libcpp_is_signed<_Tp, false> : public false_type {};
685
686template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_signed : public __libcpp_is_signed<_Tp> {};
687
688// is_unsigned
689
690template <class _Tp, bool = is_integral<_Tp>::value>
680struct ___is_unsigned : public integral_constant<bool, _Tp(0) < _Tp(-1)> {};
691struct __libcpp_is_unsigned_impl : public integral_constant<bool, _Tp(0) < _Tp(-1)> {};
681
682template <class _Tp>
692
693template <class _Tp>
683struct ___is_unsigned<_Tp, false> : public false_type {}; // floating point
694struct __libcpp_is_unsigned_impl<_Tp, false> : public false_type {}; // floating point
684
685template <class _Tp, bool = is_arithmetic<_Tp>::value>
695
696template <class _Tp, bool = is_arithmetic<_Tp>::value>
686struct __libcpp_is_unsigned : public ___is_unsigned<_Tp> {};
697struct __libcpp_is_unsigned : public __libcpp_is_unsigned_impl<_Tp> {};
687
688template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
689
690template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_unsigned : public __libcpp_is_unsigned<_Tp> {};
691
692// rank
693
694template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank

--- 77 unchanged lines hidden (view full) ---

772
773template <class _Tp, bool = is_class<_Tp>::value>
774struct __libcpp_abstract : public integral_constant<bool, sizeof(__is_abstract_imp::__test<_Tp>(0)) != 1> {};
775
776template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {};
777
778template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_abstract : public __libcpp_abstract<_Tp> {};
779
698
699template <class _Tp> struct __libcpp_is_unsigned<_Tp, false> : public false_type {};
700
701template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_unsigned : public __libcpp_is_unsigned<_Tp> {};
702
703// rank
704
705template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY rank

--- 77 unchanged lines hidden (view full) ---

783
784template <class _Tp, bool = is_class<_Tp>::value>
785struct __libcpp_abstract : public integral_constant<bool, sizeof(__is_abstract_imp::__test<_Tp>(0)) != 1> {};
786
787template <class _Tp> struct __libcpp_abstract<_Tp, false> : public false_type {};
788
789template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_abstract : public __libcpp_abstract<_Tp> {};
790
791// is_final
792
793#if _LIBCPP_STD_VER > 11 && __has_feature(is_final)
794template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY
795is_final : public integral_constant<bool, __is_final(_Tp)> {};
796#endif
797
780// is_base_of
781
782#ifdef _LIBCPP_HAS_IS_BASE_OF
783
784template <class _Bp, class _Dp>
785struct _LIBCPP_TYPE_VIS_ONLY is_base_of
786 : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
787
798// is_base_of
799
800#ifdef _LIBCPP_HAS_IS_BASE_OF
801
802template <class _Bp, class _Dp>
803struct _LIBCPP_TYPE_VIS_ONLY is_base_of
804 : public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
805
788#else // __has_feature(is_base_of)
806#else // _LIBCPP_HAS_IS_BASE_OF
789
790namespace __is_base_of_imp
791{
792template <class _Tp>
793struct _Dst
794{
795 _Dst(const volatile _Tp &);
796};

--- 8 unchanged lines hidden (view full) ---

805template <class _Bp, class _Dp> __two __test(...);
806}
807
808template <class _Bp, class _Dp>
809struct _LIBCPP_TYPE_VIS_ONLY is_base_of
810 : public integral_constant<bool, is_class<_Bp>::value &&
811 sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {};
812
807
808namespace __is_base_of_imp
809{
810template <class _Tp>
811struct _Dst
812{
813 _Dst(const volatile _Tp &);
814};

--- 8 unchanged lines hidden (view full) ---

823template <class _Bp, class _Dp> __two __test(...);
824}
825
826template <class _Bp, class _Dp>
827struct _LIBCPP_TYPE_VIS_ONLY is_base_of
828 : public integral_constant<bool, is_class<_Bp>::value &&
829 sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {};
830
813#endif // __has_feature(is_base_of)
831#endif // _LIBCPP_HAS_IS_BASE_OF
814
815// is_convertible
816
817#if __has_feature(is_convertible_to)
818
819template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
820 : public integral_constant<bool, __is_convertible_to(_T1, _T2) &&
821 !is_abstract<_T2>::value> {};

--- 106 unchanged lines hidden (view full) ---

928 static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
929 static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
930};
931
932#endif // __has_feature(is_convertible_to)
933
934// is_empty
935
832
833// is_convertible
834
835#if __has_feature(is_convertible_to)
836
837template <class _T1, class _T2> struct _LIBCPP_TYPE_VIS_ONLY is_convertible
838 : public integral_constant<bool, __is_convertible_to(_T1, _T2) &&
839 !is_abstract<_T2>::value> {};

--- 106 unchanged lines hidden (view full) ---

946 static const size_t __complete_check1 = __is_convertible_check<_T1>::__v;
947 static const size_t __complete_check2 = __is_convertible_check<_T2>::__v;
948};
949
950#endif // __has_feature(is_convertible_to)
951
952// is_empty
953
936#if __has_feature(is_empty)
954#if __has_feature(is_empty) || (_GNUC_VER >= 407)
937
938template <class _Tp>
939struct _LIBCPP_TYPE_VIS_ONLY is_empty
940 : public integral_constant<bool, __is_empty(_Tp)> {};
941
942#else // __has_feature(is_empty)
943
944template <class _Tp>

--- 14 unchanged lines hidden (view full) ---

959template <class _Tp> struct __libcpp_empty<_Tp, false> : public false_type {};
960
961template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_empty : public __libcpp_empty<_Tp> {};
962
963#endif // __has_feature(is_empty)
964
965// is_polymorphic
966
955
956template <class _Tp>
957struct _LIBCPP_TYPE_VIS_ONLY is_empty
958 : public integral_constant<bool, __is_empty(_Tp)> {};
959
960#else // __has_feature(is_empty)
961
962template <class _Tp>

--- 14 unchanged lines hidden (view full) ---

977template <class _Tp> struct __libcpp_empty<_Tp, false> : public false_type {};
978
979template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_empty : public __libcpp_empty<_Tp> {};
980
981#endif // __has_feature(is_empty)
982
983// is_polymorphic
984
967#if __has_feature(is_polymorphic)
985#if __has_feature(is_polymorphic) || defined(_LIBCPP_MSVC)
968
969template <class _Tp>
970struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
971 : public integral_constant<bool, __is_polymorphic(_Tp)> {};
972
973#else
974
975template<typename _Tp> char &__is_polymorphic_impl(
976 typename enable_if<sizeof((_Tp*)dynamic_cast<const volatile void*>(declval<_Tp*>())) != 0,
977 int>::type);
978template<typename _Tp> __two &__is_polymorphic_impl(...);
979
980template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
981 : public integral_constant<bool, sizeof(__is_polymorphic_impl<_Tp>(0)) == 1> {};
982
983#endif // __has_feature(is_polymorphic)
984
985// has_virtual_destructor
986
986
987template <class _Tp>
988struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
989 : public integral_constant<bool, __is_polymorphic(_Tp)> {};
990
991#else
992
993template<typename _Tp> char &__is_polymorphic_impl(
994 typename enable_if<sizeof((_Tp*)dynamic_cast<const volatile void*>(declval<_Tp*>())) != 0,
995 int>::type);
996template<typename _Tp> __two &__is_polymorphic_impl(...);
997
998template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_polymorphic
999 : public integral_constant<bool, sizeof(__is_polymorphic_impl<_Tp>(0)) == 1> {};
1000
1001#endif // __has_feature(is_polymorphic)
1002
1003// has_virtual_destructor
1004
987#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
1005#if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403)
988
989template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
990 : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
991
1006
1007template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
1008 : public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
1009
992#else // _LIBCPP_HAS_TYPE_TRAITS
1010#else
993
994template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
995 : public false_type {};
996
1011
1012template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
1013 : public false_type {};
1014
997#endif // _LIBCPP_HAS_TYPE_TRAITS
1015#endif
998
999// alignment_of
1000
1001template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
1002 : public integral_constant<size_t, __alignof__(_Tp)> {};
1003
1004// aligned_storage
1005

--- 158 unchanged lines hidden (view full) ---

1164};
1165
1166#if _LIBCPP_STD_VER > 11
1167template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
1168#endif
1169
1170#endif // _LIBCPP_HAS_NO_VARIADICS
1171
1016
1017// alignment_of
1018
1019template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
1020 : public integral_constant<size_t, __alignof__(_Tp)> {};
1021
1022// aligned_storage
1023

--- 158 unchanged lines hidden (view full) ---

1182};
1183
1184#if _LIBCPP_STD_VER > 11
1185template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
1186#endif
1187
1188#endif // _LIBCPP_HAS_NO_VARIADICS
1189
1190template <class _Tp>
1191struct __numeric_type
1192{
1193 static void __test(...);
1194 static float __test(float);
1195 static double __test(char);
1196 static double __test(int);
1197 static double __test(unsigned);
1198 static double __test(long);
1199 static double __test(unsigned long);
1200 static double __test(long long);
1201 static double __test(unsigned long long);
1202 static double __test(double);
1203 static long double __test(long double);
1204
1205 typedef decltype(__test(declval<_Tp>())) type;
1206 static const bool value = !is_same<type, void>::value;
1207};
1208
1209template <>
1210struct __numeric_type<void>
1211{
1212 static const bool value = true;
1213};
1214
1172// __promote
1173
1174template <class _A1, class _A2 = void, class _A3 = void,
1215// __promote
1216
1217template <class _A1, class _A2 = void, class _A3 = void,
1175 bool = (is_arithmetic<_A1>::value || is_void<_A1>::value) &&
1176 (is_arithmetic<_A2>::value || is_void<_A2>::value) &&
1177 (is_arithmetic<_A3>::value || is_void<_A3>::value)>
1178class __promote {};
1218 bool = __numeric_type<_A1>::value &&
1219 __numeric_type<_A2>::value &&
1220 __numeric_type<_A3>::value>
1221class __promote_imp
1222{
1223public:
1224 static const bool value = false;
1225};
1179
1180template <class _A1, class _A2, class _A3>
1226
1227template <class _A1, class _A2, class _A3>
1181class __promote<_A1, _A2, _A3, true>
1228class __promote_imp<_A1, _A2, _A3, true>
1182{
1183private:
1229{
1230private:
1184 typedef typename __promote<_A1>::type __type1;
1185 typedef typename __promote<_A2>::type __type2;
1186 typedef typename __promote<_A3>::type __type3;
1231 typedef typename __promote_imp<_A1>::type __type1;
1232 typedef typename __promote_imp<_A2>::type __type2;
1233 typedef typename __promote_imp<_A3>::type __type3;
1187public:
1188 typedef decltype(__type1() + __type2() + __type3()) type;
1234public:
1235 typedef decltype(__type1() + __type2() + __type3()) type;
1236 static const bool value = true;
1189};
1190
1191template <class _A1, class _A2>
1237};
1238
1239template <class _A1, class _A2>
1192class __promote<_A1, _A2, void, true>
1240class __promote_imp<_A1, _A2, void, true>
1193{
1194private:
1241{
1242private:
1195 typedef typename __promote<_A1>::type __type1;
1196 typedef typename __promote<_A2>::type __type2;
1243 typedef typename __promote_imp<_A1>::type __type1;
1244 typedef typename __promote_imp<_A2>::type __type2;
1197public:
1198 typedef decltype(__type1() + __type2()) type;
1245public:
1246 typedef decltype(__type1() + __type2()) type;
1247 static const bool value = true;
1199};
1200
1201template <class _A1>
1248};
1249
1250template <class _A1>
1202class __promote<_A1, void, void, true>
1251class __promote_imp<_A1, void, void, true>
1203{
1204public:
1252{
1253public:
1205 typedef typename conditional<is_arithmetic<_A1>::value,
1206 typename conditional<is_integral<_A1>::value, double, _A1>::type,
1207 void
1208 >::type type;
1254 typedef typename __numeric_type<_A1>::type type;
1255 static const bool value = true;
1209};
1210
1256};
1257
1258template <class _A1, class _A2 = void, class _A3 = void>
1259class __promote : public __promote_imp<_A1, _A2, _A3> {};
1260
1211#ifdef _LIBCPP_STORE_AS_OPTIMIZATION
1212
1213// __transform
1214
1215template <class _Tp, size_t = sizeof(_Tp), bool = is_scalar<_Tp>::value> struct __transform {typedef _Tp type;};
1216template <class _Tp> struct __transform<_Tp, 1, true> {typedef unsigned char type;};
1217template <class _Tp> struct __transform<_Tp, 2, true> {typedef unsigned short type;};
1218template <class _Tp> struct __transform<_Tp, 4, true> {typedef unsigned int type;};

--- 4 unchanged lines hidden (view full) ---

1223// make_signed / make_unsigned
1224
1225typedef
1226 __type_list<signed char,
1227 __type_list<signed short,
1228 __type_list<signed int,
1229 __type_list<signed long,
1230 __type_list<signed long long,
1261#ifdef _LIBCPP_STORE_AS_OPTIMIZATION
1262
1263// __transform
1264
1265template <class _Tp, size_t = sizeof(_Tp), bool = is_scalar<_Tp>::value> struct __transform {typedef _Tp type;};
1266template <class _Tp> struct __transform<_Tp, 1, true> {typedef unsigned char type;};
1267template <class _Tp> struct __transform<_Tp, 2, true> {typedef unsigned short type;};
1268template <class _Tp> struct __transform<_Tp, 4, true> {typedef unsigned int type;};

--- 4 unchanged lines hidden (view full) ---

1273// make_signed / make_unsigned
1274
1275typedef
1276 __type_list<signed char,
1277 __type_list<signed short,
1278 __type_list<signed int,
1279 __type_list<signed long,
1280 __type_list<signed long long,
1281#ifndef _LIBCPP_HAS_NO_INT128
1282 __type_list<__int128_t,
1283#endif
1231 __nat
1284 __nat
1285#ifndef _LIBCPP_HAS_NO_INT128
1286 >
1287#endif
1232 > > > > > __signed_types;
1233
1234typedef
1235 __type_list<unsigned char,
1236 __type_list<unsigned short,
1237 __type_list<unsigned int,
1238 __type_list<unsigned long,
1239 __type_list<unsigned long long,
1288 > > > > > __signed_types;
1289
1290typedef
1291 __type_list<unsigned char,
1292 __type_list<unsigned short,
1293 __type_list<unsigned int,
1294 __type_list<unsigned long,
1295 __type_list<unsigned long long,
1296#ifndef _LIBCPP_HAS_NO_INT128
1297 __type_list<__uint128_t,
1298#endif
1240 __nat
1299 __nat
1300#ifndef _LIBCPP_HAS_NO_INT128
1301 >
1302#endif
1241 > > > > > __unsigned_types;
1242
1243template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)> struct __find_first;
1244
1245template <class _Hp, class _Tp, size_t _Size>
1246struct __find_first<__type_list<_Hp, _Tp>, _Size, true>
1247{
1248 typedef _Hp type;

--- 67 unchanged lines hidden (view full) ---

1316template <> struct __make_signed< signed short, true> {typedef short type;};
1317template <> struct __make_signed<unsigned short, true> {typedef short type;};
1318template <> struct __make_signed< signed int, true> {typedef int type;};
1319template <> struct __make_signed<unsigned int, true> {typedef int type;};
1320template <> struct __make_signed< signed long, true> {typedef long type;};
1321template <> struct __make_signed<unsigned long, true> {typedef long type;};
1322template <> struct __make_signed< signed long long, true> {typedef long long type;};
1323template <> struct __make_signed<unsigned long long, true> {typedef long long type;};
1303 > > > > > __unsigned_types;
1304
1305template <class _TypeList, size_t _Size, bool = _Size <= sizeof(typename _TypeList::_Head)> struct __find_first;
1306
1307template <class _Hp, class _Tp, size_t _Size>
1308struct __find_first<__type_list<_Hp, _Tp>, _Size, true>
1309{
1310 typedef _Hp type;

--- 67 unchanged lines hidden (view full) ---

1378template <> struct __make_signed< signed short, true> {typedef short type;};
1379template <> struct __make_signed<unsigned short, true> {typedef short type;};
1380template <> struct __make_signed< signed int, true> {typedef int type;};
1381template <> struct __make_signed<unsigned int, true> {typedef int type;};
1382template <> struct __make_signed< signed long, true> {typedef long type;};
1383template <> struct __make_signed<unsigned long, true> {typedef long type;};
1384template <> struct __make_signed< signed long long, true> {typedef long long type;};
1385template <> struct __make_signed<unsigned long long, true> {typedef long long type;};
1386#ifndef _LIBCPP_HAS_NO_INT128
1387template <> struct __make_signed<__int128_t, true> {typedef __int128_t type;};
1388template <> struct __make_signed<__uint128_t, true> {typedef __int128_t type;};
1389#endif
1324
1325template <class _Tp>
1326struct _LIBCPP_TYPE_VIS_ONLY make_signed
1327{
1328 typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
1329};
1330
1331#if _LIBCPP_STD_VER > 11

--- 13 unchanged lines hidden (view full) ---

1345template <> struct __make_unsigned< signed short, true> {typedef unsigned short type;};
1346template <> struct __make_unsigned<unsigned short, true> {typedef unsigned short type;};
1347template <> struct __make_unsigned< signed int, true> {typedef unsigned int type;};
1348template <> struct __make_unsigned<unsigned int, true> {typedef unsigned int type;};
1349template <> struct __make_unsigned< signed long, true> {typedef unsigned long type;};
1350template <> struct __make_unsigned<unsigned long, true> {typedef unsigned long type;};
1351template <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;};
1352template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;};
1390
1391template <class _Tp>
1392struct _LIBCPP_TYPE_VIS_ONLY make_signed
1393{
1394 typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
1395};
1396
1397#if _LIBCPP_STD_VER > 11

--- 13 unchanged lines hidden (view full) ---

1411template <> struct __make_unsigned< signed short, true> {typedef unsigned short type;};
1412template <> struct __make_unsigned<unsigned short, true> {typedef unsigned short type;};
1413template <> struct __make_unsigned< signed int, true> {typedef unsigned int type;};
1414template <> struct __make_unsigned<unsigned int, true> {typedef unsigned int type;};
1415template <> struct __make_unsigned< signed long, true> {typedef unsigned long type;};
1416template <> struct __make_unsigned<unsigned long, true> {typedef unsigned long type;};
1417template <> struct __make_unsigned< signed long long, true> {typedef unsigned long long type;};
1418template <> struct __make_unsigned<unsigned long long, true> {typedef unsigned long long type;};
1419#ifndef _LIBCPP_HAS_NO_INT128
1420template <> struct __make_unsigned<__int128_t, true> {typedef __uint128_t type;};
1421template <> struct __make_unsigned<__uint128_t, true> {typedef __uint128_t type;};
1422#endif
1353
1354template <class _Tp>
1355struct _LIBCPP_TYPE_VIS_ONLY make_unsigned
1356{
1357 typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
1358};
1359
1360#if _LIBCPP_STD_VER > 11

--- 8 unchanged lines hidden (view full) ---

1369public:
1370 typedef typename common_type<typename common_type<_Tp, _Up>::type, V>::type type;
1371};
1372
1373template <class _Tp>
1374struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, void, void>
1375{
1376public:
1423
1424template <class _Tp>
1425struct _LIBCPP_TYPE_VIS_ONLY make_unsigned
1426{
1427 typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
1428};
1429
1430#if _LIBCPP_STD_VER > 11

--- 8 unchanged lines hidden (view full) ---

1439public:
1440 typedef typename common_type<typename common_type<_Tp, _Up>::type, V>::type type;
1441};
1442
1443template <class _Tp>
1444struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, void, void>
1445{
1446public:
1377 typedef _Tp type;
1447 typedef typename decay<_Tp>::type type;
1378};
1379
1380template <class _Tp, class _Up>
1381struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, void>
1382{
1383private:
1384#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1385 static _Tp&& __t();

--- 75 unchanged lines hidden (view full) ---

1461template <class _Tp, class _Arg>
1462struct is_assignable
1463 : public __is_assignable_imp<_Tp, _Arg> {};
1464
1465// is_copy_assignable
1466
1467template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
1468 : public is_assignable<typename add_lvalue_reference<_Tp>::type,
1448};
1449
1450template <class _Tp, class _Up>
1451struct _LIBCPP_TYPE_VIS_ONLY common_type<_Tp, _Up, void>
1452{
1453private:
1454#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1455 static _Tp&& __t();

--- 75 unchanged lines hidden (view full) ---

1531template <class _Tp, class _Arg>
1532struct is_assignable
1533 : public __is_assignable_imp<_Tp, _Arg> {};
1534
1535// is_copy_assignable
1536
1537template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
1538 : public is_assignable<typename add_lvalue_reference<_Tp>::type,
1469 const typename add_lvalue_reference<_Tp>::type> {};
1539 typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
1470
1471// is_move_assignable
1472
1473template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
1474#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1475 : public is_assignable<typename add_lvalue_reference<_Tp>::type,
1476 const typename add_rvalue_reference<_Tp>::type> {};
1477#else
1478 : public is_copy_assignable<_Tp> {};
1479#endif
1480
1481// is_destructible
1482
1540
1541// is_move_assignable
1542
1543template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
1544#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1545 : public is_assignable<typename add_lvalue_reference<_Tp>::type,
1546 const typename add_rvalue_reference<_Tp>::type> {};
1547#else
1548 : public is_copy_assignable<_Tp> {};
1549#endif
1550
1551// is_destructible
1552
1483template <class _Tp>
1484struct __destructible_test
1485{
1486 _Tp __t;
1553// if it's a reference, return true
1554// if it's a function, return false
1555// if it's void, return false
1556// if it's an array of unknown bound, return false
1557// Otherwise, return "std::declval<_Up&>().~_Up()" is well-formed
1558// where _Up is remove_all_extents<_Tp>::type
1559
1560template <class>
1561struct __is_destructible_apply { typedef int type; };
1562
1563template <typename _Tp>
1564struct __is_destructor_wellformed {
1565 template <typename _Tp1>
1566 static char __test (
1567 typename __is_destructible_apply<decltype(_VSTD::declval<_Tp1&>().~_Tp1())>::type
1568 );
1569
1570 template <typename _Tp1>
1571 static __two __test (...);
1572
1573 static const bool value = sizeof(__test<_Tp>(12)) == sizeof(char);
1487};
1488
1574};
1575
1576template <class _Tp, bool>
1577struct __destructible_imp;
1578
1489template <class _Tp>
1579template <class _Tp>
1490decltype((_VSTD::declval<__destructible_test<_Tp> >().~__destructible_test<_Tp>(), true_type()))
1491#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1492__is_destructible_test(_Tp&&);
1493#else
1494__is_destructible_test(_Tp&);
1495#endif
1580struct __destructible_imp<_Tp, false>
1581 : public _VSTD::integral_constant<bool,
1582 __is_destructor_wellformed<typename _VSTD::remove_all_extents<_Tp>::type>::value> {};
1496
1583
1497false_type
1498__is_destructible_test(__any);
1584template <class _Tp>
1585struct __destructible_imp<_Tp, true>
1586 : public _VSTD::true_type {};
1499
1587
1500template <class _Tp, bool = is_void<_Tp>::value || is_abstract<_Tp>::value
1501 || is_function<_Tp>::value>
1502struct __destructible_imp
1503 : public common_type
1504 <
1505 decltype(__is_destructible_test(declval<_Tp>()))
1506 >::type {};
1588template <class _Tp, bool>
1589struct __destructible_false;
1507
1508template <class _Tp>
1590
1591template <class _Tp>
1509struct __destructible_imp<_Tp, true>
1510 : public false_type {};
1592struct __destructible_false<_Tp, false> : public __destructible_imp<_Tp, _VSTD::is_reference<_Tp>::value> {};
1511
1512template <class _Tp>
1593
1594template <class _Tp>
1595struct __destructible_false<_Tp, true> : public _VSTD::false_type {};
1596
1597template <class _Tp>
1513struct is_destructible
1598struct is_destructible
1514 : public __destructible_imp<_Tp> {};
1599 : public __destructible_false<_Tp, _VSTD::is_function<_Tp>::value> {};
1515
1516template <class _Tp>
1517struct is_destructible<_Tp[]>
1600
1601template <class _Tp>
1602struct is_destructible<_Tp[]>
1518 : public false_type {};
1603 : public _VSTD::false_type {};
1519
1604
1605template <>
1606struct is_destructible<void>
1607 : public _VSTD::false_type {};
1608
1520// move
1521
1522#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1523
1524template <class _Tp>
1525inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
1526typename remove_reference<_Tp>::type&&
1527move(_Tp&& __t) _NOEXCEPT

--- 89 unchanged lines hidden (view full) ---

1617struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false>
1618{
1619 typedef _Class _ClassType;
1620 typedef _Rp _ReturnType;
1621 typedef _Rp (_FnType) (_Param...);
1622};
1623
1624template <class _Rp, class _Class, class ..._Param>
1609// move
1610
1611#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1612
1613template <class _Tp>
1614inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
1615typename remove_reference<_Tp>::type&&
1616move(_Tp&& __t) _NOEXCEPT

--- 89 unchanged lines hidden (view full) ---

1706struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...), true, false>
1707{
1708 typedef _Class _ClassType;
1709 typedef _Rp _ReturnType;
1710 typedef _Rp (_FnType) (_Param...);
1711};
1712
1713template <class _Rp, class _Class, class ..._Param>
1714struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...), true, false>
1715{
1716 typedef _Class _ClassType;
1717 typedef _Rp _ReturnType;
1718 typedef _Rp (_FnType) (_Param..., ...);
1719};
1720
1721template <class _Rp, class _Class, class ..._Param>
1625struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false>
1626{
1627 typedef _Class const _ClassType;
1628 typedef _Rp _ReturnType;
1629 typedef _Rp (_FnType) (_Param...);
1630};
1631
1632template <class _Rp, class _Class, class ..._Param>
1722struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const, true, false>
1723{
1724 typedef _Class const _ClassType;
1725 typedef _Rp _ReturnType;
1726 typedef _Rp (_FnType) (_Param...);
1727};
1728
1729template <class _Rp, class _Class, class ..._Param>
1730struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const, true, false>
1731{
1732 typedef _Class const _ClassType;
1733 typedef _Rp _ReturnType;
1734 typedef _Rp (_FnType) (_Param..., ...);
1735};
1736
1737template <class _Rp, class _Class, class ..._Param>
1633struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false>
1634{
1635 typedef _Class volatile _ClassType;
1636 typedef _Rp _ReturnType;
1637 typedef _Rp (_FnType) (_Param...);
1638};
1639
1640template <class _Rp, class _Class, class ..._Param>
1738struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile, true, false>
1739{
1740 typedef _Class volatile _ClassType;
1741 typedef _Rp _ReturnType;
1742 typedef _Rp (_FnType) (_Param...);
1743};
1744
1745template <class _Rp, class _Class, class ..._Param>
1746struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile, true, false>
1747{
1748 typedef _Class volatile _ClassType;
1749 typedef _Rp _ReturnType;
1750 typedef _Rp (_FnType) (_Param..., ...);
1751};
1752
1753template <class _Rp, class _Class, class ..._Param>
1641struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false>
1642{
1643 typedef _Class const volatile _ClassType;
1644 typedef _Rp _ReturnType;
1645 typedef _Rp (_FnType) (_Param...);
1646};
1647
1754struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile, true, false>
1755{
1756 typedef _Class const volatile _ClassType;
1757 typedef _Rp _ReturnType;
1758 typedef _Rp (_FnType) (_Param...);
1759};
1760
1761template <class _Rp, class _Class, class ..._Param>
1762struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile, true, false>
1763{
1764 typedef _Class const volatile _ClassType;
1765 typedef _Rp _ReturnType;
1766 typedef _Rp (_FnType) (_Param..., ...);
1767};
1768
1648#if __has_feature(cxx_reference_qualified_functions)
1649
1650template <class _Rp, class _Class, class ..._Param>
1651struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false>
1652{
1653 typedef _Class& _ClassType;
1654 typedef _Rp _ReturnType;
1655 typedef _Rp (_FnType) (_Param...);
1656};
1657
1658template <class _Rp, class _Class, class ..._Param>
1769#if __has_feature(cxx_reference_qualified_functions)
1770
1771template <class _Rp, class _Class, class ..._Param>
1772struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &, true, false>
1773{
1774 typedef _Class& _ClassType;
1775 typedef _Rp _ReturnType;
1776 typedef _Rp (_FnType) (_Param...);
1777};
1778
1779template <class _Rp, class _Class, class ..._Param>
1780struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &, true, false>
1781{
1782 typedef _Class& _ClassType;
1783 typedef _Rp _ReturnType;
1784 typedef _Rp (_FnType) (_Param..., ...);
1785};
1786
1787template <class _Rp, class _Class, class ..._Param>
1659struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false>
1660{
1661 typedef _Class const& _ClassType;
1662 typedef _Rp _ReturnType;
1663 typedef _Rp (_FnType) (_Param...);
1664};
1665
1666template <class _Rp, class _Class, class ..._Param>
1788struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&, true, false>
1789{
1790 typedef _Class const& _ClassType;
1791 typedef _Rp _ReturnType;
1792 typedef _Rp (_FnType) (_Param...);
1793};
1794
1795template <class _Rp, class _Class, class ..._Param>
1796struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&, true, false>
1797{
1798 typedef _Class const& _ClassType;
1799 typedef _Rp _ReturnType;
1800 typedef _Rp (_FnType) (_Param..., ...);
1801};
1802
1803template <class _Rp, class _Class, class ..._Param>
1667struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false>
1668{
1669 typedef _Class volatile& _ClassType;
1670 typedef _Rp _ReturnType;
1671 typedef _Rp (_FnType) (_Param...);
1672};
1673
1674template <class _Rp, class _Class, class ..._Param>
1804struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&, true, false>
1805{
1806 typedef _Class volatile& _ClassType;
1807 typedef _Rp _ReturnType;
1808 typedef _Rp (_FnType) (_Param...);
1809};
1810
1811template <class _Rp, class _Class, class ..._Param>
1812struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&, true, false>
1813{
1814 typedef _Class volatile& _ClassType;
1815 typedef _Rp _ReturnType;
1816 typedef _Rp (_FnType) (_Param..., ...);
1817};
1818
1819template <class _Rp, class _Class, class ..._Param>
1675struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false>
1676{
1677 typedef _Class const volatile& _ClassType;
1678 typedef _Rp _ReturnType;
1679 typedef _Rp (_FnType) (_Param...);
1680};
1681
1682template <class _Rp, class _Class, class ..._Param>
1820struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&, true, false>
1821{
1822 typedef _Class const volatile& _ClassType;
1823 typedef _Rp _ReturnType;
1824 typedef _Rp (_FnType) (_Param...);
1825};
1826
1827template <class _Rp, class _Class, class ..._Param>
1828struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&, true, false>
1829{
1830 typedef _Class const volatile& _ClassType;
1831 typedef _Rp _ReturnType;
1832 typedef _Rp (_FnType) (_Param..., ...);
1833};
1834
1835template <class _Rp, class _Class, class ..._Param>
1683struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false>
1684{
1685 typedef _Class&& _ClassType;
1686 typedef _Rp _ReturnType;
1687 typedef _Rp (_FnType) (_Param...);
1688};
1689
1690template <class _Rp, class _Class, class ..._Param>
1836struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) &&, true, false>
1837{
1838 typedef _Class&& _ClassType;
1839 typedef _Rp _ReturnType;
1840 typedef _Rp (_FnType) (_Param...);
1841};
1842
1843template <class _Rp, class _Class, class ..._Param>
1844struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) &&, true, false>
1845{
1846 typedef _Class&& _ClassType;
1847 typedef _Rp _ReturnType;
1848 typedef _Rp (_FnType) (_Param..., ...);
1849};
1850
1851template <class _Rp, class _Class, class ..._Param>
1691struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false>
1692{
1693 typedef _Class const&& _ClassType;
1694 typedef _Rp _ReturnType;
1695 typedef _Rp (_FnType) (_Param...);
1696};
1697
1698template <class _Rp, class _Class, class ..._Param>
1852struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const&&, true, false>
1853{
1854 typedef _Class const&& _ClassType;
1855 typedef _Rp _ReturnType;
1856 typedef _Rp (_FnType) (_Param...);
1857};
1858
1859template <class _Rp, class _Class, class ..._Param>
1860struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const&&, true, false>
1861{
1862 typedef _Class const&& _ClassType;
1863 typedef _Rp _ReturnType;
1864 typedef _Rp (_FnType) (_Param..., ...);
1865};
1866
1867template <class _Rp, class _Class, class ..._Param>
1699struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false>
1700{
1701 typedef _Class volatile&& _ClassType;
1702 typedef _Rp _ReturnType;
1703 typedef _Rp (_FnType) (_Param...);
1704};
1705
1706template <class _Rp, class _Class, class ..._Param>
1868struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) volatile&&, true, false>
1869{
1870 typedef _Class volatile&& _ClassType;
1871 typedef _Rp _ReturnType;
1872 typedef _Rp (_FnType) (_Param...);
1873};
1874
1875template <class _Rp, class _Class, class ..._Param>
1876struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) volatile&&, true, false>
1877{
1878 typedef _Class volatile&& _ClassType;
1879 typedef _Rp _ReturnType;
1880 typedef _Rp (_FnType) (_Param..., ...);
1881};
1882
1883template <class _Rp, class _Class, class ..._Param>
1707struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false>
1708{
1709 typedef _Class const volatile&& _ClassType;
1710 typedef _Rp _ReturnType;
1711 typedef _Rp (_FnType) (_Param...);
1712};
1713
1884struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param...) const volatile&&, true, false>
1885{
1886 typedef _Class const volatile&& _ClassType;
1887 typedef _Rp _ReturnType;
1888 typedef _Rp (_FnType) (_Param...);
1889};
1890
1891template <class _Rp, class _Class, class ..._Param>
1892struct __member_pointer_traits_imp<_Rp (_Class::*)(_Param..., ...) const volatile&&, true, false>
1893{
1894 typedef _Class const volatile&& _ClassType;
1895 typedef _Rp _ReturnType;
1896 typedef _Rp (_FnType) (_Param..., ...);
1897};
1898
1714#endif // __has_feature(cxx_reference_qualified_functions)
1715
1716#else // _LIBCPP_HAS_NO_VARIADICS
1717
1718template <class _Rp, class _Class>
1719struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false>
1720{
1721 typedef _Class _ClassType;
1722 typedef _Rp _ReturnType;
1723 typedef _Rp (_FnType) ();
1724};
1725
1899#endif // __has_feature(cxx_reference_qualified_functions)
1900
1901#else // _LIBCPP_HAS_NO_VARIADICS
1902
1903template <class _Rp, class _Class>
1904struct __member_pointer_traits_imp<_Rp (_Class::*)(), true, false>
1905{
1906 typedef _Class _ClassType;
1907 typedef _Rp _ReturnType;
1908 typedef _Rp (_FnType) ();
1909};
1910
1911template <class _Rp, class _Class>
1912struct __member_pointer_traits_imp<_Rp (_Class::*)(...), true, false>
1913{
1914 typedef _Class _ClassType;
1915 typedef _Rp _ReturnType;
1916 typedef _Rp (_FnType) (...);
1917};
1918
1726template <class _Rp, class _Class, class _P0>
1727struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false>
1728{
1729 typedef _Class _ClassType;
1730 typedef _Rp _ReturnType;
1731 typedef _Rp (_FnType) (_P0);
1732};
1733
1919template <class _Rp, class _Class, class _P0>
1920struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0), true, false>
1921{
1922 typedef _Class _ClassType;
1923 typedef _Rp _ReturnType;
1924 typedef _Rp (_FnType) (_P0);
1925};
1926
1927template <class _Rp, class _Class, class _P0>
1928struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...), true, false>
1929{
1930 typedef _Class _ClassType;
1931 typedef _Rp _ReturnType;
1932 typedef _Rp (_FnType) (_P0, ...);
1933};
1934
1734template <class _Rp, class _Class, class _P0, class _P1>
1735struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false>
1736{
1737 typedef _Class _ClassType;
1738 typedef _Rp _ReturnType;
1739 typedef _Rp (_FnType) (_P0, _P1);
1740};
1741
1935template <class _Rp, class _Class, class _P0, class _P1>
1936struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1), true, false>
1937{
1938 typedef _Class _ClassType;
1939 typedef _Rp _ReturnType;
1940 typedef _Rp (_FnType) (_P0, _P1);
1941};
1942
1943template <class _Rp, class _Class, class _P0, class _P1>
1944struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...), true, false>
1945{
1946 typedef _Class _ClassType;
1947 typedef _Rp _ReturnType;
1948 typedef _Rp (_FnType) (_P0, _P1, ...);
1949};
1950
1742template <class _Rp, class _Class, class _P0, class _P1, class _P2>
1743struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false>
1744{
1745 typedef _Class _ClassType;
1746 typedef _Rp _ReturnType;
1747 typedef _Rp (_FnType) (_P0, _P1, _P2);
1748};
1749
1951template <class _Rp, class _Class, class _P0, class _P1, class _P2>
1952struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2), true, false>
1953{
1954 typedef _Class _ClassType;
1955 typedef _Rp _ReturnType;
1956 typedef _Rp (_FnType) (_P0, _P1, _P2);
1957};
1958
1959template <class _Rp, class _Class, class _P0, class _P1, class _P2>
1960struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...), true, false>
1961{
1962 typedef _Class _ClassType;
1963 typedef _Rp _ReturnType;
1964 typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
1965};
1966
1750template <class _Rp, class _Class>
1751struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false>
1752{
1753 typedef _Class const _ClassType;
1754 typedef _Rp _ReturnType;
1755 typedef _Rp (_FnType) ();
1756};
1757
1967template <class _Rp, class _Class>
1968struct __member_pointer_traits_imp<_Rp (_Class::*)() const, true, false>
1969{
1970 typedef _Class const _ClassType;
1971 typedef _Rp _ReturnType;
1972 typedef _Rp (_FnType) ();
1973};
1974
1975template <class _Rp, class _Class>
1976struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const, true, false>
1977{
1978 typedef _Class const _ClassType;
1979 typedef _Rp _ReturnType;
1980 typedef _Rp (_FnType) (...);
1981};
1982
1758template <class _Rp, class _Class, class _P0>
1759struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false>
1760{
1761 typedef _Class const _ClassType;
1762 typedef _Rp _ReturnType;
1763 typedef _Rp (_FnType) (_P0);
1764};
1765
1983template <class _Rp, class _Class, class _P0>
1984struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const, true, false>
1985{
1986 typedef _Class const _ClassType;
1987 typedef _Rp _ReturnType;
1988 typedef _Rp (_FnType) (_P0);
1989};
1990
1991template <class _Rp, class _Class, class _P0>
1992struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const, true, false>
1993{
1994 typedef _Class const _ClassType;
1995 typedef _Rp _ReturnType;
1996 typedef _Rp (_FnType) (_P0, ...);
1997};
1998
1766template <class _Rp, class _Class, class _P0, class _P1>
1767struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false>
1768{
1769 typedef _Class const _ClassType;
1770 typedef _Rp _ReturnType;
1771 typedef _Rp (_FnType) (_P0, _P1);
1772};
1773
1999template <class _Rp, class _Class, class _P0, class _P1>
2000struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const, true, false>
2001{
2002 typedef _Class const _ClassType;
2003 typedef _Rp _ReturnType;
2004 typedef _Rp (_FnType) (_P0, _P1);
2005};
2006
2007template <class _Rp, class _Class, class _P0, class _P1>
2008struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const, true, false>
2009{
2010 typedef _Class const _ClassType;
2011 typedef _Rp _ReturnType;
2012 typedef _Rp (_FnType) (_P0, _P1, ...);
2013};
2014
1774template <class _Rp, class _Class, class _P0, class _P1, class _P2>
1775struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false>
1776{
1777 typedef _Class const _ClassType;
1778 typedef _Rp _ReturnType;
1779 typedef _Rp (_FnType) (_P0, _P1, _P2);
1780};
1781
2015template <class _Rp, class _Class, class _P0, class _P1, class _P2>
2016struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const, true, false>
2017{
2018 typedef _Class const _ClassType;
2019 typedef _Rp _ReturnType;
2020 typedef _Rp (_FnType) (_P0, _P1, _P2);
2021};
2022
2023template <class _Rp, class _Class, class _P0, class _P1, class _P2>
2024struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const, true, false>
2025{
2026 typedef _Class const _ClassType;
2027 typedef _Rp _ReturnType;
2028 typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
2029};
2030
1782template <class _Rp, class _Class>
1783struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false>
1784{
1785 typedef _Class volatile _ClassType;
1786 typedef _Rp _ReturnType;
1787 typedef _Rp (_FnType) ();
1788};
1789
2031template <class _Rp, class _Class>
2032struct __member_pointer_traits_imp<_Rp (_Class::*)() volatile, true, false>
2033{
2034 typedef _Class volatile _ClassType;
2035 typedef _Rp _ReturnType;
2036 typedef _Rp (_FnType) ();
2037};
2038
2039template <class _Rp, class _Class>
2040struct __member_pointer_traits_imp<_Rp (_Class::*)(...) volatile, true, false>
2041{
2042 typedef _Class volatile _ClassType;
2043 typedef _Rp _ReturnType;
2044 typedef _Rp (_FnType) (...);
2045};
2046
1790template <class _Rp, class _Class, class _P0>
1791struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false>
1792{
1793 typedef _Class volatile _ClassType;
1794 typedef _Rp _ReturnType;
1795 typedef _Rp (_FnType) (_P0);
1796};
1797
2047template <class _Rp, class _Class, class _P0>
2048struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) volatile, true, false>
2049{
2050 typedef _Class volatile _ClassType;
2051 typedef _Rp _ReturnType;
2052 typedef _Rp (_FnType) (_P0);
2053};
2054
2055template <class _Rp, class _Class, class _P0>
2056struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) volatile, true, false>
2057{
2058 typedef _Class volatile _ClassType;
2059 typedef _Rp _ReturnType;
2060 typedef _Rp (_FnType) (_P0, ...);
2061};
2062
1798template <class _Rp, class _Class, class _P0, class _P1>
1799struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false>
1800{
1801 typedef _Class volatile _ClassType;
1802 typedef _Rp _ReturnType;
1803 typedef _Rp (_FnType) (_P0, _P1);
1804};
1805
2063template <class _Rp, class _Class, class _P0, class _P1>
2064struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) volatile, true, false>
2065{
2066 typedef _Class volatile _ClassType;
2067 typedef _Rp _ReturnType;
2068 typedef _Rp (_FnType) (_P0, _P1);
2069};
2070
2071template <class _Rp, class _Class, class _P0, class _P1>
2072struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) volatile, true, false>
2073{
2074 typedef _Class volatile _ClassType;
2075 typedef _Rp _ReturnType;
2076 typedef _Rp (_FnType) (_P0, _P1, ...);
2077};
2078
1806template <class _Rp, class _Class, class _P0, class _P1, class _P2>
1807struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false>
1808{
1809 typedef _Class volatile _ClassType;
1810 typedef _Rp _ReturnType;
1811 typedef _Rp (_FnType) (_P0, _P1, _P2);
1812};
1813
2079template <class _Rp, class _Class, class _P0, class _P1, class _P2>
2080struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) volatile, true, false>
2081{
2082 typedef _Class volatile _ClassType;
2083 typedef _Rp _ReturnType;
2084 typedef _Rp (_FnType) (_P0, _P1, _P2);
2085};
2086
2087template <class _Rp, class _Class, class _P0, class _P1, class _P2>
2088struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) volatile, true, false>
2089{
2090 typedef _Class volatile _ClassType;
2091 typedef _Rp _ReturnType;
2092 typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
2093};
2094
1814template <class _Rp, class _Class>
1815struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false>
1816{
1817 typedef _Class const volatile _ClassType;
1818 typedef _Rp _ReturnType;
1819 typedef _Rp (_FnType) ();
1820};
1821
2095template <class _Rp, class _Class>
2096struct __member_pointer_traits_imp<_Rp (_Class::*)() const volatile, true, false>
2097{
2098 typedef _Class const volatile _ClassType;
2099 typedef _Rp _ReturnType;
2100 typedef _Rp (_FnType) ();
2101};
2102
2103template <class _Rp, class _Class>
2104struct __member_pointer_traits_imp<_Rp (_Class::*)(...) const volatile, true, false>
2105{
2106 typedef _Class const volatile _ClassType;
2107 typedef _Rp _ReturnType;
2108 typedef _Rp (_FnType) (...);
2109};
2110
1822template <class _Rp, class _Class, class _P0>
1823struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false>
1824{
1825 typedef _Class const volatile _ClassType;
1826 typedef _Rp _ReturnType;
1827 typedef _Rp (_FnType) (_P0);
1828};
1829
2111template <class _Rp, class _Class, class _P0>
2112struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0) const volatile, true, false>
2113{
2114 typedef _Class const volatile _ClassType;
2115 typedef _Rp _ReturnType;
2116 typedef _Rp (_FnType) (_P0);
2117};
2118
2119template <class _Rp, class _Class, class _P0>
2120struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, ...) const volatile, true, false>
2121{
2122 typedef _Class const volatile _ClassType;
2123 typedef _Rp _ReturnType;
2124 typedef _Rp (_FnType) (_P0, ...);
2125};
2126
1830template <class _Rp, class _Class, class _P0, class _P1>
1831struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false>
1832{
1833 typedef _Class const volatile _ClassType;
1834 typedef _Rp _ReturnType;
1835 typedef _Rp (_FnType) (_P0, _P1);
1836};
1837
2127template <class _Rp, class _Class, class _P0, class _P1>
2128struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1) const volatile, true, false>
2129{
2130 typedef _Class const volatile _ClassType;
2131 typedef _Rp _ReturnType;
2132 typedef _Rp (_FnType) (_P0, _P1);
2133};
2134
2135template <class _Rp, class _Class, class _P0, class _P1>
2136struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, ...) const volatile, true, false>
2137{
2138 typedef _Class const volatile _ClassType;
2139 typedef _Rp _ReturnType;
2140 typedef _Rp (_FnType) (_P0, _P1, ...);
2141};
2142
1838template <class _Rp, class _Class, class _P0, class _P1, class _P2>
1839struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false>
1840{
1841 typedef _Class const volatile _ClassType;
1842 typedef _Rp _ReturnType;
1843 typedef _Rp (_FnType) (_P0, _P1, _P2);
1844};
1845
2143template <class _Rp, class _Class, class _P0, class _P1, class _P2>
2144struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2) const volatile, true, false>
2145{
2146 typedef _Class const volatile _ClassType;
2147 typedef _Rp _ReturnType;
2148 typedef _Rp (_FnType) (_P0, _P1, _P2);
2149};
2150
2151template <class _Rp, class _Class, class _P0, class _P1, class _P2>
2152struct __member_pointer_traits_imp<_Rp (_Class::*)(_P0, _P1, _P2, ...) const volatile, true, false>
2153{
2154 typedef _Class const volatile _ClassType;
2155 typedef _Rp _ReturnType;
2156 typedef _Rp (_FnType) (_P0, _P1, _P2, ...);
2157};
2158
1846#endif // _LIBCPP_HAS_NO_VARIADICS
1847
1848template <class _Rp, class _Class>
1849struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
1850{
1851 typedef _Class _ClassType;
1852 typedef _Rp _ReturnType;
1853};

--- 478 unchanged lines hidden (view full) ---

2332struct _LIBCPP_TYPE_VIS_ONLY is_default_constructible
2333 : public is_constructible<_Tp>
2334 {};
2335
2336// is_copy_constructible
2337
2338template <class _Tp>
2339struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
2159#endif // _LIBCPP_HAS_NO_VARIADICS
2160
2161template <class _Rp, class _Class>
2162struct __member_pointer_traits_imp<_Rp _Class::*, false, true>
2163{
2164 typedef _Class _ClassType;
2165 typedef _Rp _ReturnType;
2166};

--- 478 unchanged lines hidden (view full) ---

2645struct _LIBCPP_TYPE_VIS_ONLY is_default_constructible
2646 : public is_constructible<_Tp>
2647 {};
2648
2649// is_copy_constructible
2650
2651template <class _Tp>
2652struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
2340 : public is_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
2341 {};
2653 : public is_constructible<_Tp,
2654 typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
2342
2343// is_move_constructible
2344
2345template <class _Tp>
2346struct _LIBCPP_TYPE_VIS_ONLY is_move_constructible
2347#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2348 : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
2349#else

--- 18 unchanged lines hidden (view full) ---

2368template <class _Tp, class... _Args>
2369struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
2370 : false_type
2371{
2372};
2373
2374template <class _Tp>
2375struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp>
2655
2656// is_move_constructible
2657
2658template <class _Tp>
2659struct _LIBCPP_TYPE_VIS_ONLY is_move_constructible
2660#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2661 : public is_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
2662#else

--- 18 unchanged lines hidden (view full) ---

2681template <class _Tp, class... _Args>
2682struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible
2683 : false_type
2684{
2685};
2686
2687template <class _Tp>
2688struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp>
2376#if __has_feature(has_trivial_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
2689#if __has_feature(has_trivial_constructor) || (_GNUC_VER >= 403)
2377 : integral_constant<bool, __has_trivial_constructor(_Tp)>
2378#else
2379 : integral_constant<bool, is_scalar<_Tp>::value>
2380#endif
2381{
2382};
2383
2384template <class _Tp>

--- 112 unchanged lines hidden (view full) ---

2497 : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
2498#else
2499 : public is_trivially_copy_constructible<_Tp>
2500#endif
2501 {};
2502
2503// is_trivially_assignable
2504
2690 : integral_constant<bool, __has_trivial_constructor(_Tp)>
2691#else
2692 : integral_constant<bool, is_scalar<_Tp>::value>
2693#endif
2694{
2695};
2696
2697template <class _Tp>

--- 112 unchanged lines hidden (view full) ---

2810 : public is_trivially_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
2811#else
2812 : public is_trivially_copy_constructible<_Tp>
2813#endif
2814 {};
2815
2816// is_trivially_assignable
2817
2505#if __has_feature(is_trivially_constructible)
2818#if __has_feature(is_trivially_assignable)
2506
2507template <class _Tp, class _Arg>
2508struct is_trivially_assignable
2509 : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)>
2510{
2511};
2512
2819
2820template <class _Tp, class _Arg>
2821struct is_trivially_assignable
2822 : integral_constant<bool, __is_trivially_assignable(_Tp, _Arg)>
2823{
2824};
2825
2513#else // !__has_feature(is_trivially_constructible)
2826#else // !__has_feature(is_trivially_assignable)
2514
2515template <class _Tp, class _Arg>
2516struct is_trivially_assignable
2517 : public false_type {};
2518
2519template <class _Tp>
2520struct is_trivially_assignable<_Tp&, _Tp>
2521 : integral_constant<bool, is_scalar<_Tp>::value> {};

--- 9 unchanged lines hidden (view full) ---

2531#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2532
2533template <class _Tp>
2534struct is_trivially_assignable<_Tp&, _Tp&&>
2535 : integral_constant<bool, is_scalar<_Tp>::value> {};
2536
2537#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2538
2827
2828template <class _Tp, class _Arg>
2829struct is_trivially_assignable
2830 : public false_type {};
2831
2832template <class _Tp>
2833struct is_trivially_assignable<_Tp&, _Tp>
2834 : integral_constant<bool, is_scalar<_Tp>::value> {};

--- 9 unchanged lines hidden (view full) ---

2844#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2845
2846template <class _Tp>
2847struct is_trivially_assignable<_Tp&, _Tp&&>
2848 : integral_constant<bool, is_scalar<_Tp>::value> {};
2849
2850#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2851
2539#endif // !__has_feature(is_trivially_constructible)
2852#endif // !__has_feature(is_trivially_assignable)
2540
2541// is_trivially_copy_assignable
2542
2543template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_assignable
2544 : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
2853
2854// is_trivially_copy_assignable
2855
2856template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_assignable
2857 : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
2545 const typename add_lvalue_reference<_Tp>::type>
2546 {};
2858 typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
2547
2548// is_trivially_move_assignable
2549
2550template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
2551 : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
2552#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2553 typename add_rvalue_reference<_Tp>::type>
2554#else
2555 typename add_lvalue_reference<_Tp>::type>
2556#endif
2557 {};
2558
2559// is_trivially_destructible
2560
2859
2860// is_trivially_move_assignable
2861
2862template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
2863 : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
2864#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2865 typename add_rvalue_reference<_Tp>::type>
2866#else
2867 typename add_lvalue_reference<_Tp>::type>
2868#endif
2869 {};
2870
2871// is_trivially_destructible
2872
2561#if __has_feature(has_trivial_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
2873#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
2562
2563template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
2874
2875template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
2564 : public integral_constant {};
2876 : public integral_constant<bool, is_destructible<_Tp>::value && __has_trivial_destructor(_Tp)> {};
2565
2877
2566#else // _LIBCPP_HAS_TYPE_TRAITS
2878#else
2567
2568template <class _Tp> struct __libcpp_trivial_destructor
2569 : public integral_constant<bool, is_scalar<_Tp>::value ||
2570 is_reference<_Tp>::value> {};
2571
2572template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
2573 : public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
2574
2879
2880template <class _Tp> struct __libcpp_trivial_destructor
2881 : public integral_constant<bool, is_scalar<_Tp>::value ||
2882 is_reference<_Tp>::value> {};
2883
2884template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
2885 : public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
2886
2575#endif // _LIBCPP_HAS_TYPE_TRAITS
2887#endif
2576
2577// is_nothrow_constructible
2578
2579#if 0
2580template <class _Tp, class... _Args>
2581struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2582 : public integral_constant<bool, __is_nothrow_constructible(_Tp(_Args...))>
2583{
2584};
2585
2586#else
2587
2588#ifndef _LIBCPP_HAS_NO_VARIADICS
2589
2888
2889// is_nothrow_constructible
2890
2891#if 0
2892template <class _Tp, class... _Args>
2893struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2894 : public integral_constant<bool, __is_nothrow_constructible(_Tp(_Args...))>
2895{
2896};
2897
2898#else
2899
2900#ifndef _LIBCPP_HAS_NO_VARIADICS
2901
2590#if __has_feature(cxx_noexcept)
2902#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
2591
2903
2592template struct __libcpp_is_nothrow_constructible;
2904template <bool, bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible;
2593
2594template <class _Tp, class... _Args>
2905
2906template <class _Tp, class... _Args>
2595struct __libcpp_is_nothrow_constructible<true, _Tp, _Args...>
2907struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/false, _Tp, _Args...>
2596 : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
2597{
2598};
2599
2908 : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
2909{
2910};
2911
2600template <class _Tp, class... _Args>
2601struct __libcpp_is_nothrow_constructible<false, _Tp, _Args...>
2912template
2913void __implicit_conversion_to(_Tp) noexcept { }
2914
2915template <class _Tp, class _Arg>
2916struct __libcpp_is_nothrow_constructible</*is constructible*/true, /*is reference*/true, _Tp, _Arg>
2917 : public integral_constant<bool, noexcept(__implicit_conversion_to<_Tp>(declval<_Arg>()))>
2918{
2919};
2920
2921template <class _Tp, bool _IsReference, class... _Args>
2922struct __libcpp_is_nothrow_constructible</*is constructible*/false, _IsReference, _Tp, _Args...>
2602 : public false_type
2603{
2604};
2605
2606template <class _Tp, class... _Args>
2607struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2923 : public false_type
2924{
2925};
2926
2927template <class _Tp, class... _Args>
2928struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2608 : __libcpp_is_nothrow_constructible::value, _Tp, _Args...>
2929 : __libcpp_is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, is_reference<_Tp>::value, _Tp, _Args...>
2609{
2610};
2611
2612template <class _Tp, size_t _Ns>
2613struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp[_Ns]>
2930{
2931};
2932
2933template <class _Tp, size_t _Ns>
2934struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp[_Ns]>
2614 : __libcpp_is_nothrow_constructible::value, _Tp>
2935 : __libcpp_is_nothrow_constructible<is_constructible<_Tp>::value, is_reference<_Tp>::value, _Tp>
2615{
2616};
2617
2618#else // __has_feature(cxx_noexcept)
2619
2620template <class _Tp, class... _Args>
2621struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2622 : false_type
2623{
2624};
2625
2626template <class _Tp>
2627struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp>
2936{
2937};
2938
2939#else // __has_feature(cxx_noexcept)
2940
2941template <class _Tp, class... _Args>
2942struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2943 : false_type
2944{
2945};
2946
2947template <class _Tp>
2948struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp>
2628#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
2949#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403)
2629 : integral_constant<bool, __has_nothrow_constructor(_Tp)>
2630#else
2631 : integral_constant<bool, is_scalar<_Tp>::value>
2632#endif
2633{
2634};
2635
2636template <class _Tp>
2637#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2638struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&&>
2639#else
2640struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp>
2641#endif
2950 : integral_constant<bool, __has_nothrow_constructor(_Tp)>
2951#else
2952 : integral_constant<bool, is_scalar<_Tp>::value>
2953#endif
2954{
2955};
2956
2957template <class _Tp>
2958#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2959struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&&>
2960#else
2961struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp>
2962#endif
2642#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
2963#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
2643 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2644#else
2645 : integral_constant<bool, is_scalar<_Tp>::value>
2646#endif
2647{
2648};
2649
2650template <class _Tp>
2651struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&>
2964 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2965#else
2966 : integral_constant<bool, is_scalar<_Tp>::value>
2967#endif
2968{
2969};
2970
2971template <class _Tp>
2972struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&>
2652#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
2973#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
2653 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2654#else
2655 : integral_constant<bool, is_scalar<_Tp>::value>
2656#endif
2657{
2658};
2659
2660template <class _Tp>
2661struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&>
2974 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2975#else
2976 : integral_constant<bool, is_scalar<_Tp>::value>
2977#endif
2978{
2979};
2980
2981template <class _Tp>
2982struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&>
2662#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
2983#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
2663 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2664#else
2665 : integral_constant<bool, is_scalar<_Tp>::value>
2666#endif
2667{
2668};
2669
2670#endif // __has_feature(cxx_noexcept)

--- 5 unchanged lines hidden (view full) ---

2676struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2677 : false_type
2678{
2679};
2680
2681template <class _Tp>
2682struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, __is_construct::__nat,
2683 __is_construct::__nat>
2984 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2985#else
2986 : integral_constant<bool, is_scalar<_Tp>::value>
2987#endif
2988{
2989};
2990
2991#endif // __has_feature(cxx_noexcept)

--- 5 unchanged lines hidden (view full) ---

2997struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible
2998 : false_type
2999{
3000};
3001
3002template <class _Tp>
3003struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, __is_construct::__nat,
3004 __is_construct::__nat>
2684#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3005#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403)
2685 : integral_constant<bool, __has_nothrow_constructor(_Tp)>
2686#else
2687 : integral_constant<bool, is_scalar<_Tp>::value>
2688#endif
2689{
2690};
2691
2692template <class _Tp>
2693struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp,
2694 __is_construct::__nat>
3006 : integral_constant<bool, __has_nothrow_constructor(_Tp)>
3007#else
3008 : integral_constant<bool, is_scalar<_Tp>::value>
3009#endif
3010{
3011};
3012
3013template <class _Tp>
3014struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp,
3015 __is_construct::__nat>
2695#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3016#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
2696 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2697#else
2698 : integral_constant<bool, is_scalar<_Tp>::value>
2699#endif
2700{
2701};
2702
2703template <class _Tp>
2704struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&,
2705 __is_construct::__nat>
3017 : integral_constant<bool, __has_nothrow_copy(_Tp)>
3018#else
3019 : integral_constant<bool, is_scalar<_Tp>::value>
3020#endif
3021{
3022};
3023
3024template <class _Tp>
3025struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&,
3026 __is_construct::__nat>
2706#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3027#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
2707 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2708#else
2709 : integral_constant<bool, is_scalar<_Tp>::value>
2710#endif
2711{
2712};
2713
2714template <class _Tp>
2715struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
2716 __is_construct::__nat>
3028 : integral_constant<bool, __has_nothrow_copy(_Tp)>
3029#else
3030 : integral_constant<bool, is_scalar<_Tp>::value>
3031#endif
3032{
3033};
3034
3035template <class _Tp>
3036struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
3037 __is_construct::__nat>
2717#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3038#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
2718 : integral_constant<bool, __has_nothrow_copy(_Tp)>
2719#else
2720 : integral_constant<bool, is_scalar<_Tp>::value>
2721#endif
2722{
2723};
2724
2725#endif // _LIBCPP_HAS_NO_VARIADICS
2726#endif // __has_feature(is_nothrow_constructible)
2727
2728// is_nothrow_default_constructible
2729
2730template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible
2731 : public is_nothrow_constructible<_Tp>
2732 {};
2733
2734// is_nothrow_copy_constructible
2735
2736template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
3039 : integral_constant<bool, __has_nothrow_copy(_Tp)>
3040#else
3041 : integral_constant<bool, is_scalar<_Tp>::value>
3042#endif
3043{
3044};
3045
3046#endif // _LIBCPP_HAS_NO_VARIADICS
3047#endif // __has_feature(is_nothrow_constructible)
3048
3049// is_nothrow_default_constructible
3050
3051template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible
3052 : public is_nothrow_constructible<_Tp>
3053 {};
3054
3055// is_nothrow_copy_constructible
3056
3057template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
2737 : public is_nothrow_constructible<_Tp, const typename add_lvalue_reference<_Tp>::type>
2738 {};
3058 : public is_nothrow_constructible<_Tp,
3059 typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
2739
2740// is_nothrow_move_constructible
2741
2742template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
2743#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2744 : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
2745#else
2746 : public is_nothrow_copy_constructible<_Tp>
2747#endif
2748 {};
2749
2750// is_nothrow_assignable
2751
3060
3061// is_nothrow_move_constructible
3062
3063template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
3064#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3065 : public is_nothrow_constructible<_Tp, typename add_rvalue_reference<_Tp>::type>
3066#else
3067 : public is_nothrow_copy_constructible<_Tp>
3068#endif
3069 {};
3070
3071// is_nothrow_assignable
3072
2752#if __has_feature(cxx_noexcept)
3073#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
2753
2754template <bool, class _Tp, class _Arg> struct __libcpp_is_nothrow_assignable;
2755
2756template <class _Tp, class _Arg>
2757struct __libcpp_is_nothrow_assignable<false, _Tp, _Arg>
2758 : public false_type
2759{
2760};

--- 13 unchanged lines hidden (view full) ---

2774#else // __has_feature(cxx_noexcept)
2775
2776template <class _Tp, class _Arg>
2777struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable
2778 : public false_type {};
2779
2780template <class _Tp>
2781struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp>
3074
3075template <bool, class _Tp, class _Arg> struct __libcpp_is_nothrow_assignable;
3076
3077template <class _Tp, class _Arg>
3078struct __libcpp_is_nothrow_assignable<false, _Tp, _Arg>
3079 : public false_type
3080{
3081};

--- 13 unchanged lines hidden (view full) ---

3095#else // __has_feature(cxx_noexcept)
3096
3097template <class _Tp, class _Arg>
3098struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable
3099 : public false_type {};
3100
3101template <class _Tp>
3102struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp>
2782#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3103#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
2783 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
2784#else
2785 : integral_constant<bool, is_scalar<_Tp>::value> {};
2786#endif
2787
2788template <class _Tp>
2789struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp&>
3104 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
3105#else
3106 : integral_constant<bool, is_scalar<_Tp>::value> {};
3107#endif
3108
3109template <class _Tp>
3110struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp&>
2790#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3111#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
2791 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
2792#else
2793 : integral_constant<bool, is_scalar<_Tp>::value> {};
2794#endif
2795
2796template <class _Tp>
2797struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, const _Tp&>
3112 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
3113#else
3114 : integral_constant<bool, is_scalar<_Tp>::value> {};
3115#endif
3116
3117template <class _Tp>
3118struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, const _Tp&>
2798#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3119#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
2799 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
2800#else
2801 : integral_constant<bool, is_scalar<_Tp>::value> {};
2802#endif
2803
2804#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2805
2806template <class _Tp>
2807struct is_nothrow_assignable<_Tp&, _Tp&&>
3120 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
3121#else
3122 : integral_constant<bool, is_scalar<_Tp>::value> {};
3123#endif
3124
3125#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3126
3127template <class _Tp>
3128struct is_nothrow_assignable<_Tp&, _Tp&&>
2808#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3129#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
2809 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
2810#else
2811 : integral_constant<bool, is_scalar<_Tp>::value> {};
2812#endif
2813
2814#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
2815
2816#endif // __has_feature(cxx_noexcept)
2817
2818// is_nothrow_copy_assignable
2819
2820template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_assignable
2821 : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
3130 : integral_constant<bool, __has_nothrow_assign(_Tp)> {};
3131#else
3132 : integral_constant<bool, is_scalar<_Tp>::value> {};
3133#endif
3134
3135#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
3136
3137#endif // __has_feature(cxx_noexcept)
3138
3139// is_nothrow_copy_assignable
3140
3141template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_assignable
3142 : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
2822 const typename add_lvalue_reference<_Tp>::type>
2823 {};
3143 typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
2824
2825// is_nothrow_move_assignable
2826
2827template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_assignable
2828 : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
2829#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
2830 typename add_rvalue_reference<_Tp>::type>
2831#else
2832 typename add_lvalue_reference<_Tp>::type>
2833#endif
2834 {};
2835
2836// is_nothrow_destructible
2837
3144
3145// is_nothrow_move_assignable
3146
3147template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_assignable
3148 : public is_nothrow_assignable<typename add_lvalue_reference<_Tp>::type,
3149#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
3150 typename add_rvalue_reference<_Tp>::type>
3151#else
3152 typename add_lvalue_reference<_Tp>::type>
3153#endif
3154 {};
3155
3156// is_nothrow_destructible
3157
2838#if __has_feature(cxx_noexcept)
3158#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
2839
2840template <bool, class _Tp> struct __libcpp_is_nothrow_destructible;
2841
2842template <class _Tp>
2843struct __libcpp_is_nothrow_destructible<false, _Tp>
2844 : public false_type
2845{
2846};

--- 40 unchanged lines hidden (view full) ---

2887
2888template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
2889 : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
2890
2891#endif
2892
2893// is_pod
2894
3159
3160template <bool, class _Tp> struct __libcpp_is_nothrow_destructible;
3161
3162template <class _Tp>
3163struct __libcpp_is_nothrow_destructible<false, _Tp>
3164 : public false_type
3165{
3166};

--- 40 unchanged lines hidden (view full) ---

3207
3208template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible
3209 : public __libcpp_nothrow_destructor<typename remove_all_extents<_Tp>::type> {};
3210
3211#endif
3212
3213// is_pod
3214
2895#if __has_feature(is_pod) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
3215#if __has_feature(is_pod) || (_GNUC_VER >= 403)
2896
2897template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
2898 : public integral_constant<bool, __is_pod(_Tp)> {};
2899
3216
3217template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
3218 : public integral_constant<bool, __is_pod(_Tp)> {};
3219
2900#else // _LIBCPP_HAS_TYPE_TRAITS
3220#else
2901
2902template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
2903 : public integral_constant<bool, is_trivially_default_constructible<_Tp>::value &&
2904 is_trivially_copy_constructible<_Tp>::value &&
2905 is_trivially_copy_assignable<_Tp>::value &&
2906 is_trivially_destructible<_Tp>::value> {};
2907
3221
3222template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
3223 : public integral_constant<bool, is_trivially_default_constructible<_Tp>::value &&
3224 is_trivially_copy_constructible<_Tp>::value &&
3225 is_trivially_copy_assignable<_Tp>::value &&
3226 is_trivially_destructible<_Tp>::value> {};
3227
2908#endif // _LIBCPP_HAS_TYPE_TRAITS
3228#endif
2909
2910// is_literal_type;
2911
2912template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_literal_type
3229
3230// is_literal_type;
3231
3232template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_literal_type
2913#if __has_feature(is_literal)
2914 : public integral_constant<bool, __is_literal(_Tp)>
3233#ifdef _LIBCPP_IS_LITERAL
3234 : public integral_constant<bool, _LIBCPP_IS_LITERAL(_Tp)>
2915#else
2916 : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value ||
2917 is_reference<typename remove_all_extents<_Tp>::type>::value>
2918#endif
2919 {};
2920
2921// is_standard_layout;
2922
2923template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_standard_layout
3235#else
3236 : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value ||
3237 is_reference<typename remove_all_extents<_Tp>::type>::value>
3238#endif
3239 {};
3240
3241// is_standard_layout;
3242
3243template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_standard_layout
2924#if __has_feature(is_standard_layout)
3244#if __has_feature(is_standard_layout) || (_GNUC_VER >= 407)
2925 : public integral_constant<bool, __is_standard_layout(_Tp)>
2926#else
2927 : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
2928#endif
2929 {};
2930
2931// is_trivially_copyable;
2932
2933template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copyable
2934#if __has_feature(is_trivially_copyable)
2935 : public integral_constant<bool, __is_trivially_copyable(_Tp)>
2936#else
2937 : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
2938#endif
2939 {};
2940
2941// is_trivial;
2942
2943template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivial
3245 : public integral_constant<bool, __is_standard_layout(_Tp)>
3246#else
3247 : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
3248#endif
3249 {};
3250
3251// is_trivially_copyable;
3252
3253template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copyable
3254#if __has_feature(is_trivially_copyable)
3255 : public integral_constant<bool, __is_trivially_copyable(_Tp)>
3256#else
3257 : integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
3258#endif
3259 {};
3260
3261// is_trivial;
3262
3263template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivial
2944#if __has_feature(is_trivial)
3264#if __has_feature(is_trivial) || (_GNUC_VER >= 407)
2945 : public integral_constant<bool, __is_trivial(_Tp)>
2946#else
2947 : integral_constant<bool, is_trivially_copyable<_Tp>::value &&
2948 is_trivially_default_constructible<_Tp>::value>
2949#endif
2950 {};
2951
2952#ifndef _LIBCPP_HAS_NO_VARIADICS

--- 152 unchanged lines hidden (view full) ---

3105 -> __nat;
3106
3107// bullets 1 and 2
3108
3109template <class _Fp, class _A0, class ..._Args,
3110 class = typename enable_if
3111 <
3112 is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
3265 : public integral_constant<bool, __is_trivial(_Tp)>
3266#else
3267 : integral_constant<bool, is_trivially_copyable<_Tp>::value &&
3268 is_trivially_default_constructible<_Tp>::value>
3269#endif
3270 {};
3271
3272#ifndef _LIBCPP_HAS_NO_VARIADICS

--- 152 unchanged lines hidden (view full) ---

3425 -> __nat;
3426
3427// bullets 1 and 2
3428
3429template <class _Fp, class _A0, class ..._Args,
3430 class = typename enable_if
3431 <
3432 is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
3113 is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
3433 is_base_of<typename remove_reference<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType>::type,
3114 typename remove_reference<_A0>::type>::value
3115 >::type
3116 >
3117_LIBCPP_INLINE_VISIBILITY
3118auto
3119__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3120 -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
3121
3122template <class _Fp, class _A0, class ..._Args,
3123 class = typename enable_if
3124 <
3125 is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
3434 typename remove_reference<_A0>::type>::value
3435 >::type
3436 >
3437_LIBCPP_INLINE_VISIBILITY
3438auto
3439__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3440 -> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
3441
3442template <class _Fp, class _A0, class ..._Args,
3443 class = typename enable_if
3444 <
3445 is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
3126 !is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
3446 !is_base_of<typename remove_reference<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType>::type,
3127 typename remove_reference<_A0>::type>::value
3128 >::type
3129 >
3130_LIBCPP_INLINE_VISIBILITY
3131auto
3132__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3133 -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
3134

--- 131 unchanged lines hidden (view full) ---

3266} // __detail
3267
3268template <class _Tp>
3269struct __is_swappable
3270 : public integral_constant<bool, __detail::__swappable<_Tp>::value>
3271{
3272};
3273
3447 typename remove_reference<_A0>::type>::value
3448 >::type
3449 >
3450_LIBCPP_INLINE_VISIBILITY
3451auto
3452__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
3453 -> decltype(((*_VSTD::forward<_A0>(__a0)).*__f)(_VSTD::forward<_Args>(__args)...));
3454

--- 131 unchanged lines hidden (view full) ---

3586} // __detail
3587
3588template <class _Tp>
3589struct __is_swappable
3590 : public integral_constant<bool, __detail::__swappable<_Tp>::value>
3591{
3592};
3593
3274#if __has_feature(cxx_noexcept)
3594#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
3275
3276template <bool, class _Tp>
3277struct __is_nothrow_swappable_imp
3278 : public integral_constant<bool, noexcept(swap(_VSTD::declval<_Tp&>(),
3279 _VSTD::declval<_Tp&>()))>
3280{
3281};
3282

--- 14 unchanged lines hidden (view full) ---

3297template <class _Tp>
3298struct __is_nothrow_swappable
3299 : public false_type
3300{
3301};
3302
3303#endif // __has_feature(cxx_noexcept)
3304
3595
3596template <bool, class _Tp>
3597struct __is_nothrow_swappable_imp
3598 : public integral_constant<bool, noexcept(swap(_VSTD::declval<_Tp&>(),
3599 _VSTD::declval<_Tp&>()))>
3600{
3601};
3602

--- 14 unchanged lines hidden (view full) ---

3617template <class _Tp>
3618struct __is_nothrow_swappable
3619 : public false_type
3620{
3621};
3622
3623#endif // __has_feature(cxx_noexcept)
3624
3305#ifdef _LIBCXX_UNDERLYING_TYPE
3625#ifdef _LIBCPP_UNDERLYING_TYPE
3306
3307template <class _Tp>
3308struct underlying_type
3309{
3626
3627template <class _Tp>
3628struct underlying_type
3629{
3310 typedef _LIBCXX_UNDERLYING_TYPE(_Tp) type;
3630 typedef _LIBCPP_UNDERLYING_TYPE(_Tp) type;
3311};
3312
3313#if _LIBCPP_STD_VER > 11
3314template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
3315#endif
3316
3631};
3632
3633#if _LIBCPP_STD_VER > 11
3634template <class _Tp> using underlying_type_t = typename underlying_type<_Tp>::type;
3635#endif
3636
3317#else // _LIBCXX_UNDERLYING_TYPE
3637#else // _LIBCPP_UNDERLYING_TYPE
3318
3319template <class _Tp, bool _Support = false>
3320struct underlying_type
3321{
3322 static_assert(_Support, "The underyling_type trait requires compiler "
3323 "support. Either no such support exists or "
3324 "libc++ does not know how to use it.");
3325};
3326
3638
3639template <class _Tp, bool _Support = false>
3640struct underlying_type
3641{
3642 static_assert(_Support, "The underyling_type trait requires compiler "
3643 "support. Either no such support exists or "
3644 "libc++ does not know how to use it.");
3645};
3646
3327#endif // _LIBCXX_UNDERLYING_TYPE
3647#endif // _LIBCPP_UNDERLYING_TYPE
3328
3329#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
3330
3331template <class _Tp>
3648
3649#ifndef _LIBCPP_HAS_NO_ADVANCED_SFINAE
3650
3651template <class _Tp>
3332struct __has_operator_addressof_imp
3652struct __has_operator_addressof_member_imp
3333{
3653{
3654 template <class _Up>
3655 static auto __test(int)
3656 -> typename __select_2nd<decltype(_VSTD::declval<_Up>().operator&()), true_type>::type;
3334 template <class>
3657 template <class>
3335 static auto __test(__any) -> false_type;
3658 static auto __test(long) -> false_type;
3659
3660 static const bool value = decltype(__test<_Tp>(0))::value;
3661};
3662
3663template <class _Tp>
3664struct __has_operator_addressof_free_imp
3665{
3336 template <class _Up>
3666 template <class _Up>
3337 static auto __test(_Up* __u)
3338 -> typename __select_2nd<decltype(__u->operator&()), true_type>::type;
3667 static auto __test(int)
3668 -> typename __select_2nd<decltype(operator&(_VSTD::declval<_Up>())), true_type>::type;
3669 template <class>
3670 static auto __test(long) -> false_type;
3339
3671
3340 static const bool value = decltype(__test<_Tp>(nullptr))::value;
3672 static const bool value = decltype(__test<_Tp>(0))::value;
3341};
3342
3343template <class _Tp>
3344struct __has_operator_addressof
3673};
3674
3675template <class _Tp>
3676struct __has_operator_addressof
3345 : public integral_constant<bool, __has_operator_addressof_imp<_Tp>::value>
3677 : public integral_constant<bool, __has_operator_addressof_member_imp<_Tp>::value
3678 || __has_operator_addressof_free_imp<_Tp>::value>
3346{};
3347
3348#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
3349
3679{};
3680
3681#endif // _LIBCPP_HAS_NO_ADVANCED_SFINAE
3682
3683#if _LIBCPP_STD_VER > 14
3684template <class...> using void_t = void;
3685#endif
3686
3350_LIBCPP_END_NAMESPACE_STD
3351
3352#endif // _LIBCPP_TYPE_TRAITS
3687_LIBCPP_END_NAMESPACE_STD
3688
3689#endif // _LIBCPP_TYPE_TRAITS