[PATCH] D46964: Implement class deduction guides for `std::array`

Marshall Clow via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri May 18 14:02:02 PDT 2018


mclow.lists added inline comments.


================
Comment at: include/array:75
 
+  template <class T, class... U>
+    array(T, U...) -> array<T, 1 + sizeof...(U)>;
----------------
EricWF wrote:
> Don't we normally comment `// C++17` or similar for new features in the synopsis?
we do.


================
Comment at: include/array:361
+#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES
+template<class _Tp, class... _Args,
+         class = typename enable_if<(is_same_v<_Tp, _Args> && ...), void>::type
----------------
EricWF wrote:
> The `is same` clause is a requirement, not a SFINAE constraint. Should this be a hard error? Should we really SFINAE it?
If we SFINAE it, then we'll get a hard error; because there are no other deduction guides.


================
Comment at: test/std/containers/sequences/array/array.cons/deduct.fail.cpp:12
+// UNSUPPORTED: c++98, c++03, c++11, c++14
+// XFAIL: libcpp-no-deduction-guides
+
----------------
EricWF wrote:
> This should be `UNSUPPORTED`. We don't expect this test to ever pass without deduction guides.
OK


https://reviews.llvm.org/D46964





More information about the cfe-commits mailing list