[PATCH] D55840: P0722R3: Implement library support for destroying delete

Louis Dionne via Phabricator reviews at reviews.llvm.org
Mon Jan 7 09:30:33 PST 2019


ldionne added a reviewer: ldionne.
ldionne added a comment.

In D55840#1348304 <https://reviews.llvm.org/D55840#1348304>, @mclow.lists wrote:

> Another question - why do we need to check if clang supports destroying delete to define the type `destroying_delete_t`? Why not define it always, and just define the feature test macro when we have compiler support?


I'm not a big fan of this approach. It seems better to define `__cpp_lib_destroying_delete` if and only if we provide `destroying_delete_t`, which makes sense if and only if the compiler has support for it (i.e. `__cpp_impl_destroying_delete` is defined).



================
Comment at: include/new:37
 enum class align_val_t : size_t {}; // C++17
+struct destroying_delete_t {
+  explicit destroying_delete_t() = default;
----------------
Please note that those are C++20 additions.


================
Comment at: include/new:169
+
+struct destroying_delete_t {
+  explicit destroying_delete_t() = default;
----------------
Please guard with > C++17. We should not enable features in older standards unless we have a compelling reason to.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D55840





More information about the libcxx-commits mailing list