[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 09:43:02 PST 2020
Mordante added a comment.
In D91004#2381509 <https://reviews.llvm.org/D91004#2381509>, @cjdb wrote:
> I'd actually been hoping to merge my ranges library <https://github.com/cjdb/cjdb-ranges> since ~March, but reviews are a major blocker and so I've put it on hold for now. Once @ldionne has the time to review, I'll resume contributing.
I had a quick look at the library and it seems rather complete. Is it complete or are there still pieces missing?
================
Comment at: libcxx/test/std/concepts/concept.destructible/destructible.pass.cpp:56
+ static_assert( std::destructible<NoexceptDependant<int>>);
+ static_assert(!std::destructible<NoexceptDependant<double>>);
+}
----------------
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.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D91004/new/
https://reviews.llvm.org/D91004
More information about the libcxx-commits
mailing list