diff options
Diffstat (limited to 'libstdc++-v3/include/std/tuple')
-rw-r--r-- | libstdc++-v3/include/std/tuple | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index c9ea2a8..797d8c0 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -42,9 +42,14 @@ #if __cplusplus > 201703L # include <compare> # include <bits/ranges_util.h> // for std::ranges::subrange -# define __cpp_lib_constexpr_tuple 201811L #endif +#define __glibcxx_want_constexpr_tuple +#define __glibcxx_want_tuples_by_type +#define __glibcxx_want_apply +#define __glibcxx_want_make_from_tuple +#include <bits/version.h> + namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION @@ -1820,10 +1825,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION get(const tuple<_Elements...>&) = delete; /// @endcond -#if __cplusplus >= 201402L - -#define __cpp_lib_tuples_by_type 201304L - +#ifdef __cpp_lib_tuples_by_type // C++ >= 14 /// Return a reference to the unique element of type _Tp of a tuple. template <typename _Tp, typename... _Types> constexpr _Tp& @@ -2254,8 +2256,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...) { } -#if __cplusplus >= 201703L - +#if defined(__cpp_lib_apply) || defined(__cpp_lib_make_from_tuple) // C++ >= 17 // Unpack a std::tuple into a type trait and use its value. // For cv std::tuple<_Up> the result is _Trait<_Tp, cv _Up...>::value. // For cv std::tuple<_Up>& the result is _Trait<_Tp, cv _Up&...>::value. @@ -2278,9 +2279,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION template<template<typename...> class _Trait, typename _Tp, typename... _Up> inline constexpr bool __unpack_std_tuple<_Trait, _Tp, const tuple<_Up...>&> = _Trait<_Tp, const _Up&...>::value; +#endif -# define __cpp_lib_apply 201603L - +#ifdef __cpp_lib_apply // C++ >= 17 template <typename _Fn, typename _Tuple, size_t... _Idx> constexpr decltype(auto) __apply_impl(_Fn&& __f, _Tuple&& __t, index_sequence<_Idx...>) @@ -2300,9 +2301,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION std::forward<_Tuple>(__t), _Indices{}); } +#endif -#define __cpp_lib_make_from_tuple 201606L - +#ifdef __cpp_lib_make_from_tuple // C++ >= 17 template <typename _Tp, typename _Tuple, size_t... _Idx> constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, index_sequence<_Idx...>) @@ -2324,7 +2325,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION return __make_from_tuple_impl<_Tp>(std::forward<_Tuple>(__t), make_index_sequence<__n>{}); } -#endif // C++17 +#endif #if __cplusplus > 202002L template<typename... _TTypes, typename... _UTypes, |