[libcxx-commits] [PATCH] D131315: [WIP] [libc++] Implement P2273R3 (`constexpr` `unique_ptr`)

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Aug 6 02:47:12 PDT 2022


philnik added a comment.

Thanks for working on this! This obviously needs more testing. I've got a few nit-picks, otherwise the diff looks good for now.



================
Comment at: libcxx/include/__memory/unique_ptr.h:45-46
 
-  _LIBCPP_INLINE_VISIBILITY void operator()(_Tp* __ptr) const _NOEXCEPT {
+  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_CXX23
+  void operator()(_Tp* __ptr) const _NOEXCEPT {
     static_assert(sizeof(_Tp) >= 0, "cannot delete an incomplete type");
----------------
I'd prefer it if you leave the `operator()` on the same line.


================
Comment at: libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.special/cmp_nullptr.pass.cpp:48-51
+#if TEST_STD_VER >= 23
+  // checks below have unspecified value so can't be used in compile time.
+  if (!std::is_constant_evaluated())
+#endif
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131315/new/

https://reviews.llvm.org/D131315



More information about the libcxx-commits mailing list