[PATCH] D44865: [libc++] Implement P0608R1 - A sane variant converting constructor

Eric Fiselier via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 26 19:29:28 PDT 2018


EricWF added a comment.

Has this paper been adopted into the standard yet?



================
Comment at: include/variant:1097
+{
+    static void test();
+};
----------------
I see no need to stop using `operator()` in favor of a static function. Is there a reason?

Also this would have to be `__test`.


================
Comment at: include/variant:1109
 
+#define _LIBCPP_VARIANT_BOOLEAN_CONVERSION(bool_type)                    \
+    template <class... _Types>                                           \
----------------
I would like to see a version of this patch that doesn't use preprocessor expansion to specialize `__overload` multiple times.

Perhaps adding a `bool = is_same<remove_cv_t<First>, bool>` to `__overload` and then specializing once on that?


Repository:
  rCXX libc++

https://reviews.llvm.org/D44865





More information about the cfe-commits mailing list