From 2d26d4ce69d8510e32a5a4b9653de9dee0109f04 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Thu, 14 Jun 2018 20:02:40 +0100 Subject: [PATCH] Partially revert move of std::tuple_element_t to Defining std::tuple_element_t in makes it available wherever std::tuple_element is available. * include/std/tuple (__cpp_lib_tuple_element_t, tuple_element_t): Move back to . * include/std/utility (__cpp_lib_tuple_element_t. tuple_element_t): Restore to here. From-SVN: r261604 --- libstdc++-v3/ChangeLog | 5 +++++ libstdc++-v3/include/std/tuple | 7 ------- libstdc++-v3/include/std/utility | 10 ++++++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 94541d1a68d..2bfda083ee3 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2018-06-14 Jonathan Wakely + * include/std/tuple (__cpp_lib_tuple_element_t, tuple_element_t): + Move back to . + * include/std/utility (__cpp_lib_tuple_element_t. tuple_element_t): + Restore to here. + P0935R0 Eradicating unnecessarily explicit default constructors * include/backward/strstream (strstreambuf): Add non-explicit default constructor. diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 0f890504889..dd7daf7f1cf 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -1298,13 +1298,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION "tuple index is in range"); }; -#if __cplusplus >= 201402L -#define __cpp_lib_tuple_element_t 201402L - - template - using tuple_element_t = typename tuple_element<__i, _Tp>::type; -#endif - template constexpr _Head& __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility index 7bf80de3745..17e7d4cbe7a 100644 --- a/libstdc++-v3/include/std/utility +++ b/libstdc++-v3/include/std/utility @@ -135,6 +135,16 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type; }; +#if __cplusplus >= 201402L +// The standard says this macro and alias template should be in +// but we define them here, to be available when the partial specializations +// of tuple_element> and tuple_element> are defined. +#define __cpp_lib_tuple_element_t 201402L + + template + using tuple_element_t = typename tuple_element<__i, _Tp>::type; +#endif + // Various functions which give std::pair a tuple-like interface. /// Partial specialization for std::pair -- 2.30.2