From 24299f6544bebf5d462437118ad96f1fa63d813b Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 15 Aug 2016 15:46:47 +0300 Subject: [PATCH] Add a feature macro for C++17 make_from_tuple. * include/std/tuple (__cpp_lib_make_from_tuple): New. * testsuite/20_util/tuple/make_from_tuple/1.cc: Adjust. From-SVN: r239480 --- libstdc++-v3/ChangeLog | 8 ++++++++ libstdc++-v3/include/std/tuple | 4 +++- libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc | 6 ++++++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 829f78e1409..05ee02a1398 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2016-08-15 Ville Voutilainen + + Add a feature macro for C++17 make_from_tuple. + * include/std/tuple (__cpp_lib_make_from_tuple): New. + (__make_from_tuple_impl(_Tuple&&, index_sequence<_Idx...>)): + Qualify the call to get<>(). + * testsuite/20_util/tuple/make_from_tuple/1.cc: Adjust. + 2016-08-15 Uros Bizjak * src/filesystem/ops.cc: Always include ostream and diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 340304853bd..29db833e700 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -1656,10 +1656,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _Indices{}); } +#define __cpp_lib_make_from_tuple 201606 + template constexpr _Tp __make_from_tuple_impl(_Tuple&& __t, index_sequence<_Idx...>) - { return _Tp(get<_Idx>(std::forward<_Tuple>(__t))...); } + { return _Tp(std::get<_Idx>(std::forward<_Tuple>(__t))...); } template constexpr _Tp diff --git a/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc b/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc index 459dc74cd04..17aca311575 100644 --- a/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc +++ b/libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc @@ -20,6 +20,12 @@ #include #include +#ifndef __cpp_lib_make_from_tuple +# error "Feature-test macro for make_from_tuple missing." +#elif __cpp_lib_make_from_tuple < 201606 +# error "Feature-test macro for make_from_tuple has the wrong value." +#endif + template struct ThreeParam { -- 2.30.2