]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Optimize std::destructible concept
authorJonathan Wakely <jwakely@redhat.com>
Thu, 10 Nov 2022 01:30:45 +0000 (01:30 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 10 Nov 2022 01:59:34 +0000 (01:59 +0000)
commit0cbb756fe9c8e13a743bdcf599481b31bd01ddbc
tree2a41cb67dad91858a7cdf29b722537638087a0eb
parent1cdfd0e5cd5fc1f493d0832ed65d31320f9585b7
libstdc++: Optimize std::destructible concept

This uses variable templates and constraints to define a much simpler
std::destructible concept. This avoids instantiating the trait
std::is_nothrow_destructible and all its implementation in terms of
__is_destructible_safe and __is_destructible_impl.

If we had an intrinsic we could just use that (PR c++/107600).

libstdc++-v3/ChangeLog:

* include/std/concepts (__detail::__destructible_impl)
(__detail::__destructible): New variable templates.
(destructible): Use __detail::__destructible.
* testsuite/std/concepts/concepts.lang/concept.destructible/1.cc:
Add more checks for array and reference types.
libstdc++-v3/include/std/concepts
libstdc++-v3/testsuite/std/concepts/concepts.lang/concept.destructible/1.cc