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

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Feb 12 09:31:55 PST 2019


ldionne added inline comments.


================
Comment at: include/new:169
+
+struct destroying_delete_t {
+  explicit destroying_delete_t() = default;
----------------
EricWF wrote:
> mclow.lists wrote:
> > ckennelly wrote:
> > > ldionne wrote:
> > > > Please guard with > C++17. We should not enable features in older standards unless we have a compelling reason to.
> > > If there's compiler support (we're checking _impl), would it be reasonable to provide it with C++17 as well?
> > Not reasonable, no.
> > I did this one, for something that I thought was a slam-dunk (`string_view` in pre-c++17) and it has been nothing but a series of small annoyances.
> > 
> This is a separate question from `std::string_view`. This is a core-language feature that needs library support. The compiler decides whether this feature is on or off.
> 
> Like aligned allocation and sized delete, the library should provide `destroying_delete_t` whenever the compiler defines its language feature test macro. Otherwise, Clang can't do its job. This approach allows users to opt-into important new language features as an extension, or to opt-out of them when availability is a concern (this is particularly important for allocation/deallocation functions).
> 
> We should enable the typedef when either `_LIBCPP_STD_VER > 17` or `defined(__cpp_impl_destroying_delete)`. The latter macro signify that Clang needs us to provide the type because *clang* has chosen to provide this language feature as an extension.
I agree, this should be `#if _LIBCPP_STD_VER > 17 || defined(__cpp_impl_destroying_delete)`.


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