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

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 16 12:17:52 PST 2017


efriedma added inline comments.


================
Comment at: include/new:174
+_LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY
+constexpr _Tp* launder(_Tp* __p) noexcept { return __p;}
+#endif
----------------
efriedma wrote:
> How is the compiler supposed to know that "std::__1::launder()" has special semantics?
Oh, wait, is this actually not in the __1 namespace?  Sort of hard to tell because the patch wasn't posted with enough context.

It isn't exactly great to special-case functions named "std::launder"... but wouldn't be the first name in the std namespace which has special compiler semantics.


https://reviews.llvm.org/D40144





More information about the cfe-commits mailing list