Add a feature macro for C++17 make_from_tuple.
authorVille Voutilainen <ville.voutilainen@gmail.com>
Mon, 15 Aug 2016 12:46:47 +0000 (15:46 +0300)
committerVille Voutilainen <ville@gcc.gnu.org>
Mon, 15 Aug 2016 12:46:47 +0000 (15:46 +0300)
* 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
libstdc++-v3/include/std/tuple
libstdc++-v3/testsuite/20_util/tuple/make_from_tuple/1.cc

index 829f78e1409f7e7c40201748bd9f19f714894dde..05ee02a1398b27883c782a6f2c58d7e6f044170b 100644 (file)
@@ -1,3 +1,11 @@
+2016-08-15  Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       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  <ubizjak@gmail.com>
 
        * src/filesystem/ops.cc: Always include ostream and
index 340304853bdc3506c32f3d754c288117e798b1c8..29db833e70007e03033620c4b42daf34c96dffb0 100644 (file)
@@ -1656,10 +1656,12 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                          _Indices{});
     }
 
+#define __cpp_lib_make_from_tuple  201606
+
   template <typename _Tp, typename _Tuple, size_t... _Idx>
     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 <typename _Tp, typename _Tuple>
     constexpr _Tp
index 459dc74cd044339f9b5be00707d9ce089a6b6dc6..17aca3115754c8688acee41fb4fcdf80eba44ca9 100644 (file)
 #include <tuple>
 #include <testsuite_hooks.h>
 
+#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 <class T, class U, class V>
 struct ThreeParam
 {