template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_reference<_Tp&&> : public true_type {};
#endif
-#if defined(__clang__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
-#define _LIBCPP_HAS_TYPE_TRAITS
-#endif
-
// is_union
-#if __has_feature(is_union) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(is_union) || (_GNUC_VER >= 403)
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_union
: public integral_constant<bool, __is_union(_Tp)> {};
// is_class
-#if __has_feature(is_class) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(is_class) || (_GNUC_VER >= 403)
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_class
: public integral_constant<bool, __is_class(_Tp)> {};
namespace __libcpp_is_member_function_pointer_imp {
- template <typename _Tp>
- char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *);
+ template <typename _Tp>
+ char __test(typename std::__member_pointer_traits_imp<_Tp, true, false>::_FnType *);
- template <typename>
- std::__two __test(...);
+ template <typename>
+ std::__two __test(...);
};
-
+
template <class _Tp> struct __libcpp_is_member_function_pointer
: public integral_constant<bool, sizeof(__libcpp_is_member_function_pointer_imp::__test<_Tp>(nullptr)) == 1> {};
// is_enum
-#if __has_feature(is_enum) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(is_enum) || (_GNUC_VER >= 403)
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_enum
: public integral_constant<bool, __is_enum(_Tp)> {};
struct _LIBCPP_TYPE_VIS_ONLY is_base_of
: public integral_constant<bool, __is_base_of(_Bp, _Dp)> {};
-#else // __has_feature(is_base_of)
+#else // _LIBCPP_HAS_IS_BASE_OF
namespace __is_base_of_imp
{
: public integral_constant<bool, is_class<_Bp>::value &&
sizeof(__is_base_of_imp::__test<_Bp, _Dp>(0)) == 2> {};
-#endif // __has_feature(is_base_of)
+#endif // _LIBCPP_HAS_IS_BASE_OF
// is_convertible
// is_empty
-#if __has_feature(is_empty)
+#if __has_feature(is_empty) || (_GNUC_VER >= 407)
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_empty
// has_virtual_destructor
-#if __has_feature(has_virtual_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_virtual_destructor) || (_GNUC_VER >= 403)
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
: public integral_constant<bool, __has_virtual_destructor(_Tp)> {};
-#else // _LIBCPP_HAS_TYPE_TRAITS
+#else
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
: public false_type {};
-#endif // _LIBCPP_HAS_TYPE_TRAITS
+#endif
// alignment_of
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp>
-#if __has_feature(has_trivial_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_trivial_constructor) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_trivial_constructor(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
// is_trivially_assignable
-#if __has_feature(is_trivially_constructible)
+#if __has_feature(is_trivially_assignable)
template <class _Tp, class _Arg>
struct is_trivially_assignable
{
};
-#else // !__has_feature(is_trivially_constructible)
+#else // !__has_feature(is_trivially_assignable)
template <class _Tp, class _Arg>
struct is_trivially_assignable
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
-#endif // !__has_feature(is_trivially_constructible)
+#endif // !__has_feature(is_trivially_assignable)
// is_trivially_copy_assignable
// is_trivially_destructible
-#if __has_feature(has_trivial_destructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
: public integral_constant<bool, __has_trivial_destructor(_Tp)> {};
-#else // _LIBCPP_HAS_TYPE_TRAITS
+#else
template <class _Tp> struct __libcpp_trivial_destructor
: public integral_constant<bool, is_scalar<_Tp>::value ||
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible
: public __libcpp_trivial_destructor<typename remove_all_extents<_Tp>::type> {};
-#endif // _LIBCPP_HAS_TYPE_TRAITS
+#endif
// is_nothrow_constructible
#ifndef _LIBCPP_HAS_NO_VARIADICS
-#if __has_feature(cxx_noexcept)
+#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
template <bool, class _Tp, class... _Args> struct __libcpp_is_nothrow_constructible;
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp>
-#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_constructor(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
#else
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp>
#endif
-#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&>
-#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&>
-#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, __is_construct::__nat,
__is_construct::__nat>
-#if __has_feature(has_nothrow_constructor) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_constructor) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_constructor(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp,
__is_construct::__nat>
-#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, const _Tp&,
__is_construct::__nat>
-#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
__is_construct::__nat>
-#if __has_feature(has_nothrow_copy) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_copy) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_copy(_Tp)>
#else
: integral_constant<bool, is_scalar<_Tp>::value>
// is_nothrow_assignable
-#if __has_feature(cxx_noexcept)
+#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
template <bool, class _Tp, class _Arg> struct __libcpp_is_nothrow_assignable;
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp>
-#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
: integral_constant<bool, is_scalar<_Tp>::value> {};
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, _Tp&>
-#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
: integral_constant<bool, is_scalar<_Tp>::value> {};
template <class _Tp>
struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_assignable<_Tp&, const _Tp&>
-#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
: integral_constant<bool, is_scalar<_Tp>::value> {};
template <class _Tp>
struct is_nothrow_assignable<_Tp&, _Tp&&>
-#if __has_feature(has_nothrow_assign) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(has_nothrow_assign) || (_GNUC_VER >= 403)
: integral_constant<bool, __has_nothrow_assign(_Tp)> {};
#else
: integral_constant<bool, is_scalar<_Tp>::value> {};
// is_nothrow_destructible
-#if __has_feature(cxx_noexcept)
+#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
template <bool, class _Tp> struct __libcpp_is_nothrow_destructible;
// is_pod
-#if __has_feature(is_pod) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
+#if __has_feature(is_pod) || (_GNUC_VER >= 403)
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
: public integral_constant<bool, __is_pod(_Tp)> {};
-#else // _LIBCPP_HAS_TYPE_TRAITS
+#else
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_pod
: public integral_constant<bool, is_trivially_default_constructible<_Tp>::value &&
is_trivially_copy_assignable<_Tp>::value &&
is_trivially_destructible<_Tp>::value> {};
-#endif // _LIBCPP_HAS_TYPE_TRAITS
+#endif
// is_literal_type;
// is_standard_layout;
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_standard_layout
-#if __has_feature(is_standard_layout)
+#if __has_feature(is_standard_layout) || (_GNUC_VER >= 407)
: public integral_constant<bool, __is_standard_layout(_Tp)>
#else
: integral_constant<bool, is_scalar<typename remove_all_extents<_Tp>::type>::value>
// is_trivial;
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivial
-#if __has_feature(is_trivial)
+#if __has_feature(is_trivial) || (_GNUC_VER >= 407)
: public integral_constant<bool, __is_trivial(_Tp)>
#else
: integral_constant<bool, is_trivially_copyable<_Tp>::value &&
{
};
-#if __has_feature(cxx_noexcept)
+#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
template <bool, class _Tp>
struct __is_nothrow_swappable_imp