[PATCH] D40144: Implement `std::launder`

Tim Song via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 20 13:22:36 PST 2017


tcanens added inline comments.


================
Comment at: include/new:260
+    static_assert (!is_function<_Tp>::value, "can't launder functions" );
+    static_assert (!is_same_v<void, remove_cv_t<_Tp>>, "can't launder cv-void" );
+#ifdef _LIBCPP_COMPILER_HAS_BUILTIN_LAUNDER
----------------
Technically, the attempt is to launder //pointers to// //cv// `void`/functions. :)

Also, since `__launder` is non-C++17-specific, I guess it can't use `_t` and `_v` after all... - and I suppose it'll also need to parens-protect the `is_same` check for the fallback `static_assert` macro?


https://reviews.llvm.org/D40144





More information about the cfe-commits mailing list