[libcxx-commits] [PATCH] D91004: [libc++] Implements concept destructible

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Nov 8 11:54:28 PST 2020


Mordante marked an inline comment as done.
Mordante added inline comments.


================
Comment at: libcxx/test/std/concepts/concept.destructible/destructible.pass.cpp:56
+    static_assert( std::destructible<NoexceptDependant<int>>);
+    static_assert(!std::destructible<NoexceptDependant<double>>);
+}
----------------
miscco wrote:
> Mordante wrote:
> > cjdb wrote:
> > > @CaseyCarter had this to say back in D74291.
> > > 
> > > > There's tons of coverage here for class types and reference types. What about `void`, function types, pointers, arrays, pointers-to-members? (I don't know about clang/libc++, but the MSVC STL tests for type traits tend to _be_ the tests for compiler intrinsics used to implement those traits, so we consequently cover everything under the sun.)
> > > 
> > > I'd suggest we apply this here as well.
> > Normally I would agree with this comment. However the concept is just a small wrapper for `is_nothrow_destructible_v<T>` so I thought some sanity checks would suffice. The tests of `is_nothrow_destructible` already tests the type trait.
> > 
> > I've also created a not-yet-posted patch for `constructible_from` which takes the same approach.
> > 
> > For my WIP patch for `default_initializable` I'm busy adding a lot more tests since this concept is not a simple wrapper for a type trait. For that patch I feel the additional tests are required.
> I believe we should be as comprehensive as possible. There is no guarantee that in the future we would change the implementation or whatever. So each feature should get all the love it needs
Of course I can copy paste the tests from `is_nothrow_destructible`, but then there's no guarantee they'll remain in sync. What's your opinion @ldionne ?


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

https://reviews.llvm.org/D91004



More information about the libcxx-commits mailing list