[PATCH] [libc++] Try and prevent evaluation of `is_default_constructible` on tuples default constructor if it is not needed.

Agustín Bergé kaballo86 at hotmail.com
Thu Feb 12 16:39:26 PST 2015


================
Comment at: include/tuple:514
@@ -513,2 +513,3 @@
 
     template <bool _Dummy = true, class _Up = typename enable_if<
+        __all<__dependent_type<is_default_constructible<_Tp>, _Dummy>::value...>::value
----------------
Nitpick, no need to name `_Up` here.

================
Comment at: test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.pass.cpp:39
@@ +38,3 @@
+    IllFormedDefaultImp(T x) : value(x) {}
+    constexpr IllFormedDefaultImp() {}
+    T value;
----------------
Could this constructor be made ill-formed in a more obvious way? For instance, would a `static_assert` dependent on `T` achieve the same effect?

http://reviews.llvm.org/D7569

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the cfe-commits mailing list