summaryrefslogtreecommitdiffstats
path: root/contrib/libc++/include/tuple
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libc++/include/tuple')
-rw-r--r--contrib/libc++/include/tuple292
1 files changed, 151 insertions, 141 deletions
diff --git a/contrib/libc++/include/tuple b/contrib/libc++/include/tuple
index 0df315e..a1a7bcf 100644
--- a/contrib/libc++/include/tuple
+++ b/contrib/libc++/include/tuple
@@ -21,19 +21,19 @@ template <class... T>
class tuple {
public:
constexpr tuple();
- explicit tuple(const T&...);
+ explicit tuple(const T&...); // constexpr in C++14
template <class... U>
- explicit tuple(U&&...);
+ explicit tuple(U&&...); // constexpr in C++14
tuple(const tuple&) = default;
tuple(tuple&&) = default;
template <class... U>
- tuple(const tuple<U...>&);
+ tuple(const tuple<U...>&); // constexpr in C++14
template <class... U>
- tuple(tuple<U...>&&);
+ tuple(tuple<U...>&&); // constexpr in C++14
template <class U1, class U2>
- tuple(const pair<U1, U2>&); // iff sizeof...(T) == 2
+ tuple(const pair<U1, U2>&); // iff sizeof...(T) == 2 // constexpr in C++14
template <class U1, class U2>
- tuple(pair<U1, U2>&&); // iff sizeof...(T) == 2
+ tuple(pair<U1, U2>&&); // iff sizeof...(T) == 2 // constexpr in C++14
// allocator-extended constructors
template <class Alloc>
@@ -72,10 +72,10 @@ public:
const unspecified ignore;
-template <class... T> tuple<V...> make_tuple(T&&...);
-template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept;
+template <class... T> tuple<V...> make_tuple(T&&...); // constexpr in C++14
+template <class... T> tuple<ATypes...> forward_as_tuple(T&&...) noexcept; // constexpr in C++14
template <class... T> tuple<T&...> tie(T&...) noexcept;
-template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls);
+template <class... Tuples> tuple<CTypes...> tuple_cat(Tuples&&... tpls); // constexpr in C++14
// 20.4.1.4, tuple helper classes:
template <class T> class tuple_size; // undefined
@@ -86,21 +86,28 @@ template <intsize_t I, class... T> class tuple_element<I, tuple<T...>>;
// 20.4.1.5, element access:
template <intsize_t I, class... T>
typename tuple_element<I, tuple<T...>>::type&
- get(tuple<T...>&) noexcept;
+ get(tuple<T...>&) noexcept; // constexpr in C++14
template <intsize_t I, class... T>
typename tuple_element<I, tuple<T...>>::type const&
- get(const tuple<T...>&) noexcept;
+ get(const tuple<T...>&) noexcept; // constexpr in C++14
template <intsize_t I, class... T>
typename tuple_element<I, tuple<T...>>::type&&
- get(tuple<T...>&&) noexcept;
+ get(tuple<T...>&&) noexcept; // constexpr in C++14
+
+template <class T1, class... T>
+ constexpr T1& get(tuple<T...>&) noexcept; // C++14
+template <class T1, class... T>
+ constexpr T1 const& get(const tuple<T...>&) noexcept; // C++14
+template <class T1, class... T>
+ constexpr T1&& get(tuple<T...>&&) noexcept; // C++14
// 20.4.1.6, relational operators:
-template<class... T, class... U> bool operator==(const tuple<T...>&, const tuple<U...>&);
-template<class... T, class... U> bool operator<(const tuple<T...>&, const tuple<U...>&);
-template<class... T, class... U> bool operator!=(const tuple<T...>&, const tuple<U...>&);
-template<class... T, class... U> bool operator>(const tuple<T...>&, const tuple<U...>&);
-template<class... T, class... U> bool operator<=(const tuple<T...>&, const tuple<U...>&);
-template<class... T, class... U> bool operator>=(const tuple<T...>&, const tuple<U...>&);
+template<class... T, class... U> bool operator==(const tuple<T...>&, const tuple<U...>&); // constexpr in C++14
+template<class... T, class... U> bool operator<(const tuple<T...>&, const tuple<U...>&); // constexpr in C++14
+template<class... T, class... U> bool operator!=(const tuple<T...>&, const tuple<U...>&); // constexpr in C++14
+template<class... T, class... U> bool operator>(const tuple<T...>&, const tuple<U...>&); // constexpr in C++14
+template<class... T, class... U> bool operator<=(const tuple<T...>&, const tuple<U...>&); // constexpr in C++14
+template<class... T, class... U> bool operator>=(const tuple<T...>&, const tuple<U...>&); // constexpr in C++14
template <class... Types, class Alloc>
struct uses_allocator<tuple<Types...>, Alloc>;
@@ -126,74 +133,12 @@ template <class... Types>
_LIBCPP_BEGIN_NAMESPACE_STD
-// allocator_arg_t
-
-struct _LIBCPP_TYPE_VIS allocator_arg_t { };
-
-#if defined(_LIBCPP_HAS_NO_CONSTEXPR) || defined(_LIBCPP_BUILDING_MEMORY)
-extern const allocator_arg_t allocator_arg;
-#else
-constexpr allocator_arg_t allocator_arg = allocator_arg_t();
-#endif
-
-// uses_allocator
-
-template <class _Tp>
-struct __has_allocator_type
-{
-private:
- struct __two {char __lx; char __lxx;};
- template <class _Up> static __two __test(...);
- template <class _Up> static char __test(typename _Up::allocator_type* = 0);
-public:
- static const bool value = sizeof(__test<_Tp>(0)) == 1;
-};
-
-template <class _Tp, class _Alloc, bool = __has_allocator_type<_Tp>::value>
-struct __uses_allocator
- : public integral_constant<bool,
- is_convertible<_Alloc, typename _Tp::allocator_type>::value>
-{
-};
-
-template <class _Tp, class _Alloc>
-struct __uses_allocator<_Tp, _Alloc, false>
- : public false_type
-{
-};
-
-template <class _Tp, class _Alloc>
-struct _LIBCPP_TYPE_VIS uses_allocator
- : public __uses_allocator<_Tp, _Alloc>
-{
-};
-
-#ifndef _LIBCPP_HAS_NO_VARIADICS
-
-// uses-allocator construction
-
-template <class _Tp, class _Alloc, class ..._Args>
-struct __uses_alloc_ctor_imp
-{
- static const bool __ua = uses_allocator<_Tp, _Alloc>::value;
- static const bool __ic =
- is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value;
- static const int value = __ua ? 2 - __ic : 0;
-};
-
-template <class _Tp, class _Alloc, class ..._Args>
-struct __uses_alloc_ctor
- : integral_constant<int, __uses_alloc_ctor_imp<_Tp, _Alloc, _Args...>::value>
- {};
-
-#endif // _LIBCPP_HAS_NO_VARIADICS
-
#ifndef _LIBCPP_HAS_NO_VARIADICS
// tuple_size
template <class ..._Tp>
-class _LIBCPP_TYPE_VIS tuple_size<tuple<_Tp...> >
+class _LIBCPP_TYPE_VIS_ONLY tuple_size<tuple<_Tp...> >
: public integral_constant<size_t, sizeof...(_Tp)>
{
};
@@ -201,7 +146,7 @@ class _LIBCPP_TYPE_VIS tuple_size<tuple<_Tp...> >
// tuple_element
template <size_t _Ip, class ..._Tp>
-class _LIBCPP_TYPE_VIS tuple_element<_Ip, tuple<_Tp...> >
+class _LIBCPP_TYPE_VIS_ONLY tuple_element<_Ip, tuple<_Tp...> >
{
public:
typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
@@ -259,7 +204,7 @@ public:
template <class _Tp,
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
: value(_VSTD::forward<_Tp>(__t))
{static_assert(!is_reference<_Hp>::value ||
@@ -316,15 +261,17 @@ public:
>::value)),
"Attempted to construct a reference element in a tuple with an rvalue");}
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
__tuple_leaf(const __tuple_leaf& __t) _NOEXCEPT_(is_nothrow_copy_constructible<_Hp>::value)
: value(__t.get())
{static_assert(!is_rvalue_reference<_Hp>::value, "Can not copy a tuple with rvalue reference member");}
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
- explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
- _NOEXCEPT_((is_nothrow_constructible<_Hp, const _Tp&>::value))
- : value(__t.get()) {}
+ _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_CONSTEXPR_AFTER_CXX11
+ __tuple_leaf(__tuple_leaf&& __t) _NOEXCEPT_(is_nothrow_move_constructible<_Hp>::value)
+ : value(_VSTD::forward<_Hp>(__t.get()))
+ {}
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
@@ -342,8 +289,8 @@ public:
return 0;
}
- _LIBCPP_INLINE_VISIBILITY _Hp& get() _NOEXCEPT {return value;}
- _LIBCPP_INLINE_VISIBILITY const _Hp& get() const _NOEXCEPT {return value;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Hp& get() _NOEXCEPT {return value;}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp& get() const _NOEXCEPT {return value;}
};
template <size_t _Ip, class _Hp>
@@ -372,7 +319,7 @@ public:
template <class _Tp,
class = typename enable_if<is_constructible<_Hp, _Tp>::value>::type>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit __tuple_leaf(_Tp&& __t) _NOEXCEPT_((is_nothrow_constructible<_Hp, _Tp>::value))
: _Hp(_VSTD::forward<_Tp>(__t)) {}
@@ -393,12 +340,6 @@ public:
template <class _Tp>
_LIBCPP_INLINE_VISIBILITY
- explicit __tuple_leaf(const __tuple_leaf<_Ip, _Tp>& __t)
- _NOEXCEPT_((is_nothrow_constructible<_Hp, const _Tp&>::value))
- : _Hp(__t.get()) {}
-
- template <class _Tp>
- _LIBCPP_INLINE_VISIBILITY
__tuple_leaf&
operator=(_Tp&& __t) _NOEXCEPT_((is_nothrow_assignable<_Hp&, _Tp>::value))
{
@@ -414,8 +355,8 @@ public:
return 0;
}
- _LIBCPP_INLINE_VISIBILITY _Hp& get() _NOEXCEPT {return static_cast<_Hp&>(*this);}
- _LIBCPP_INLINE_VISIBILITY const _Hp& get() const _NOEXCEPT {return static_cast<const _Hp&>(*this);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Hp& get() _NOEXCEPT {return static_cast<_Hp&>(*this);}
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const _Hp& get() const _NOEXCEPT {return static_cast<const _Hp&>(*this);}
};
template <class ..._Tp>
@@ -450,7 +391,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
template <size_t ..._Uf, class ..._Tf,
size_t ..._Ul, class ..._Tl, class ..._Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit
__tuple_impl(__tuple_indices<_Uf...>, __tuple_types<_Tf...>,
__tuple_indices<_Ul...>, __tuple_types<_Tl...>,
@@ -480,7 +421,7 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
__tuple_constructible<_Tuple, tuple<_Tp...> >::value
>::type
>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
__tuple_impl(_Tuple&& __t) _NOEXCEPT_((__all<is_nothrow_constructible<_Tp, typename tuple_element<_Indx,
typename __make_tuple_types<_Tuple>::type>::type>::value...>::value))
: __tuple_leaf<_Indx, _Tp>(_VSTD::forward<typename tuple_element<_Indx,
@@ -516,13 +457,24 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
return *this;
}
- _LIBCPP_INLINE_VISIBILITY
- __tuple_impl&
- operator=(const __tuple_impl& __t) _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
- {
- __swallow(__tuple_leaf<_Indx, _Tp>::operator=(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t).get())...);
- return *this;
- }
+ __tuple_impl(const __tuple_impl&) = default;
+ __tuple_impl(__tuple_impl&&) = default;
+
+ _LIBCPP_INLINE_VISIBILITY
+ __tuple_impl&
+ operator=(const __tuple_impl& __t) _NOEXCEPT_((__all<is_nothrow_copy_assignable<_Tp>::value...>::value))
+ {
+ __swallow(__tuple_leaf<_Indx, _Tp>::operator=(static_cast<const __tuple_leaf<_Indx, _Tp>&>(__t).get())...);
+ return *this;
+ }
+
+ _LIBCPP_INLINE_VISIBILITY
+ __tuple_impl&
+ operator=(__tuple_impl&& __t) _NOEXCEPT_((__all<is_nothrow_move_assignable<_Tp>::value...>::value))
+ {
+ __swallow(__tuple_leaf<_Indx, _Tp>::operator=(_VSTD::forward<_Tp>(static_cast<__tuple_leaf<_Indx, _Tp>&>(__t).get()))...);
+ return *this;
+ }
_LIBCPP_INLINE_VISIBILITY
void swap(__tuple_impl& __t)
@@ -533,17 +485,17 @@ struct __tuple_impl<__tuple_indices<_Indx...>, _Tp...>
};
template <class ..._Tp>
-class _LIBCPP_TYPE_VIS tuple
+class _LIBCPP_TYPE_VIS_ONLY tuple
{
typedef __tuple_impl<typename __make_tuple_indices<sizeof...(_Tp)>::type, _Tp...> base;
base base_;
- template <size_t _Jp, class ..._Up> friend
+ template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Jp, tuple<_Up...> >::type& get(tuple<_Up...>&) _NOEXCEPT;
- template <size_t _Jp, class ..._Up> friend
+ template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Jp, tuple<_Up...> >::type& get(const tuple<_Up...>&) _NOEXCEPT;
- template <size_t _Jp, class ..._Up> friend
+ template <size_t _Jp, class ..._Up> friend _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Jp, tuple<_Up...> >::type&& get(tuple<_Up...>&&) _NOEXCEPT;
public:
@@ -551,7 +503,7 @@ public:
_LIBCPP_CONSTEXPR tuple()
_NOEXCEPT_(__all<is_nothrow_default_constructible<_Tp>::value...>::value) {}
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit tuple(const _Tp& ... __t) _NOEXCEPT_((__all<is_nothrow_copy_constructible<_Tp>::value...>::value))
: base_(typename __make_tuple_indices<sizeof...(_Tp)>::type(),
typename __make_tuple_types<tuple, sizeof...(_Tp)>::type(),
@@ -586,7 +538,7 @@ public:
bool
>::type = false
>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple(_Up&&... __u)
_NOEXCEPT_((
is_nothrow_constructible<
@@ -626,7 +578,7 @@ public:
bool
>::type =false
>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit
tuple(_Up&&... __u)
_NOEXCEPT_((
@@ -674,7 +626,7 @@ public:
bool
>::type = false
>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
: base_(_VSTD::forward<_Tuple>(__t)) {}
@@ -686,7 +638,7 @@ public:
bool
>::type = false
>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
explicit
tuple(_Tuple&& __t) _NOEXCEPT_((is_nothrow_constructible<base, _Tuple>::value))
: base_(_VSTD::forward<_Tuple>(__t)) {}
@@ -721,7 +673,7 @@ public:
};
template <>
-class _LIBCPP_TYPE_VIS tuple<>
+class _LIBCPP_TYPE_VIS_ONLY tuple<>
{
public:
_LIBCPP_INLINE_VISIBILITY
@@ -756,7 +708,7 @@ swap(tuple<_Tp...>& __t, tuple<_Tp...>& __u)
// get
template <size_t _Ip, class ..._Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&
get(tuple<_Tp...>& __t) _NOEXCEPT
{
@@ -765,7 +717,7 @@ get(tuple<_Tp...>& __t) _NOEXCEPT
}
template <size_t _Ip, class ..._Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
const typename tuple_element<_Ip, tuple<_Tp...> >::type&
get(const tuple<_Tp...>& __t) _NOEXCEPT
{
@@ -774,7 +726,7 @@ get(const tuple<_Tp...>& __t) _NOEXCEPT
}
template <size_t _Ip, class ..._Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename tuple_element<_Ip, tuple<_Tp...> >::type&&
get(tuple<_Tp...>&& __t) _NOEXCEPT
{
@@ -783,6 +735,64 @@ get(tuple<_Tp...>&& __t) _NOEXCEPT
static_cast<__tuple_leaf<_Ip, type>&&>(__t.base_).get());
}
+#if _LIBCPP_STD_VER > 11
+// get by type
+template <typename _T1, size_t _Idx, typename... _Args>
+struct __find_exactly_one_t_helper;
+
+// -- find exactly one
+template <typename _T1, size_t _Idx, typename... _Args>
+struct __find_exactly_one_t_checker {
+ static constexpr size_t value = _Idx;
+// Check the rest of the list to make sure there's only one
+ static_assert ( __find_exactly_one_t_helper<_T1, 0, _Args...>::value == -1, "type can only occur once in type list" );
+ };
+
+
+template <typename _T1, size_t _Idx>
+struct __find_exactly_one_t_helper <_T1, _Idx> {
+ static constexpr size_t value = -1;
+ };
+
+template <typename _T1, size_t _Idx, typename _Head, typename... _Args>
+struct __find_exactly_one_t_helper <_T1, _Idx, _Head, _Args...> {
+ static constexpr size_t value =
+ std::conditional<
+ std::is_same<_T1, _Head>::value,
+ __find_exactly_one_t_checker<_T1, _Idx, _Args...>,
+ __find_exactly_one_t_helper <_T1, _Idx+1, _Args...>
+ >::type::value;
+ };
+
+template <typename _T1, typename... _Args>
+struct __find_exactly_one_t {
+ static constexpr size_t value = __find_exactly_one_t_helper<_T1, 0, _Args...>::value;
+ static_assert ( value != -1, "type not found in type list" );
+ };
+
+template <class _T1, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1& get(tuple<_Args...>& __tup) noexcept
+{
+ return _VSTD::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup);
+}
+
+template <class _T1, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1 const& get(tuple<_Args...> const& __tup) noexcept
+{
+ return _VSTD::get<__find_exactly_one_t<_T1, _Args...>::value>(__tup);
+}
+
+template <class _T1, class... _Args>
+inline _LIBCPP_INLINE_VISIBILITY
+constexpr _T1&& get(tuple<_Args...>&& __tup) noexcept
+{
+ return _VSTD::get<__find_exactly_one_t<_T1, _Args...>::value>(_VSTD::move(__tup));
+}
+
+#endif
+
// tie
template <class ..._Tp>
@@ -803,7 +813,7 @@ struct __ignore_t
namespace { const __ignore_t<unsigned char> ignore = __ignore_t<unsigned char>(); }
-template <class _Tp> class _LIBCPP_TYPE_VIS reference_wrapper;
+template <class _Tp> class _LIBCPP_TYPE_VIS_ONLY reference_wrapper;
template <class _Tp>
struct ___make_tuple_return
@@ -824,7 +834,7 @@ struct __make_tuple_return
};
template <class... _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple<typename __make_tuple_return<_Tp>::type...>
make_tuple(_Tp&&... __t)
{
@@ -832,7 +842,7 @@ make_tuple(_Tp&&... __t)
}
template <class... _Tp>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple<_Tp&&...>
forward_as_tuple(_Tp&&... __t) _NOEXCEPT
{
@@ -843,7 +853,7 @@ template <size_t _Ip>
struct __tuple_equal
{
template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool operator()(const _Tp& __x, const _Up& __y)
{
return __tuple_equal<_Ip - 1>()(__x, __y) && get<_Ip-1>(__x) == get<_Ip-1>(__y);
@@ -854,7 +864,7 @@ template <>
struct __tuple_equal<0>
{
template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool operator()(const _Tp&, const _Up&)
{
return true;
@@ -862,7 +872,7 @@ struct __tuple_equal<0>
};
template <class ..._Tp, class ..._Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool
operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@@ -870,7 +880,7 @@ operator==(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool
operator!=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@@ -881,7 +891,7 @@ template <size_t _Ip>
struct __tuple_less
{
template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool operator()(const _Tp& __x, const _Up& __y)
{
return __tuple_less<_Ip-1>()(__x, __y) ||
@@ -893,7 +903,7 @@ template <>
struct __tuple_less<0>
{
template <class _Tp, class _Up>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool operator()(const _Tp&, const _Up&)
{
return false;
@@ -901,7 +911,7 @@ struct __tuple_less<0>
};
template <class ..._Tp, class ..._Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool
operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@@ -909,7 +919,7 @@ operator<(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool
operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@@ -917,7 +927,7 @@ operator>(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool
operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@@ -925,7 +935,7 @@ operator>=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
}
template <class ..._Tp, class ..._Up>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
bool
operator<=(const tuple<_Tp...>& __x, const tuple<_Up...>& __y)
{
@@ -983,7 +993,7 @@ struct __tuple_cat_return<>
typedef tuple<> type;
};
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
tuple<>
tuple_cat()
{
@@ -1030,16 +1040,16 @@ template <class ..._Types, size_t ..._I0, size_t ..._J0>
struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J0...> >
{
template <class _Tuple0>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&>::type
operator()(tuple<_Types...> __t, _Tuple0&& __t0)
{
- return _VSTD::forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
+ return forward_as_tuple(_VSTD::forward<_Types>(get<_I0>(__t))...,
get<_J0>(_VSTD::forward<_Tuple0>(__t0))...);
}
template <class _Tuple0, class _Tuple1, class ..._Tuples>
- _LIBCPP_INLINE_VISIBILITY
+ _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename __tuple_cat_return_ref<tuple<_Types...>&&, _Tuple0&&, _Tuple1&&, _Tuples&&...>::type
operator()(tuple<_Types...> __t, _Tuple0&& __t0, _Tuple1&& __t1, _Tuples&& ...__tpls)
{
@@ -1049,7 +1059,7 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
tuple<_Types..., typename __apply_cv<_Tuple0, typename tuple_element<_J0, _T0>::type>::type&&...>,
typename __make_tuple_indices<sizeof ...(_Types) + tuple_size<_T0>::value>::type,
typename __make_tuple_indices<tuple_size<_T1>::value>::type>()
- (_VSTD::forward_as_tuple(
+ (forward_as_tuple(
_VSTD::forward<_Types>(get<_I0>(__t))...,
get<_J0>(_VSTD::forward<_Tuple0>(__t0))...
),
@@ -1059,7 +1069,7 @@ struct __tuple_cat<tuple<_Types...>, __tuple_indices<_I0...>, __tuple_indices<_J
};
template <class _Tuple0, class... _Tuples>
-inline _LIBCPP_INLINE_VISIBILITY
+inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
typename __tuple_cat_return<_Tuple0, _Tuples...>::type
tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
{
@@ -1071,7 +1081,7 @@ tuple_cat(_Tuple0&& __t0, _Tuples&&... __tpls)
}
template <class ..._Tp, class _Alloc>
-struct _LIBCPP_TYPE_VIS uses_allocator<tuple<_Tp...>, _Alloc>
+struct _LIBCPP_TYPE_VIS_ONLY uses_allocator<tuple<_Tp...>, _Alloc>
: true_type {};
template <class _T1, class _T2>
OpenPOWER on IntegriCloud