From: Jonathan Wakely
Date: Tue, 15 Nov 2016 19:32:44 +0000 (+0000)
Subject: Make std::tuple_size SFINAE-friendly (LWG 2770)
X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ae2ae3b84615e5e4504a1592af6a8d5579f17ca;p=gcc.git
Make std::tuple_size SFINAE-friendly (LWG 2770)
* doc/xml/manual/intro.xml: Document LWG 2770 status. Remove entries
for 2742 and 2748.
* doc/html/*: Regenerate.
* include/std/utility (__tuple_size_cv_impl): New helper to safely
detect tuple_size::value, as per LWG 2770.
(tuple_size): Adjust partial specializations to derive from
__tuple_size_cv_impl.
* testsuite/20_util/tuple/cv_tuple_size.cc: Test SFINAE-friendliness.
From-SVN: r242452
---
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 77669da173f..6bf1ecbcf0e 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,14 @@
2016-11-15 Jonathan Wakely
+ * doc/xml/manual/intro.xml: Document LWG 2770 status. Remove entries
+ for 2742 and 2748.
+ * doc/html/*: Regenerate.
+ * include/std/utility (__tuple_size_cv_impl): New helper to safely
+ detect tuple_size::value, as per LWG 2770.
+ (tuple_size): Adjust partial specializations to derive from
+ __tuple_size_cv_impl.
+ * testsuite/20_util/tuple/cv_tuple_size.cc: Test SFINAE-friendliness.
+
* testsuite/libstdc++-prettyprinters/cxx17.cc: Adjust test for
variant.
diff --git a/libstdc++-v3/doc/html/manual/bugs.html b/libstdc++-v3/doc/html/manual/bugs.html
index d4a39d82e89..ee39a954c5c 100644
--- a/libstdc++-v3/doc/html/manual/bugs.html
+++ b/libstdc++-v3/doc/html/manual/bugs.html
@@ -503,14 +503,10 @@
priority_queue
lacking comparator typedef
Define the value_compare
typedef.
-
2742:
- Inconsistent string
interface taking string_view
+
2770:
+ tuple_size<const T>
specialization is not
+ SFINAE compatible and breaks decomposition declarations
- Add the new constructor and additionally constrain it
- to avoid ambiguities with non-const charT*
.
-
2748:
- swappable traits for optionals
-
- Disable the non-member swap
overload when
- the contained object is not swappable.
+
Safely detect tuple_size<T>::value
and
+ only use it if valid.