]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Optimize std::to_address
authorJonathan Wakely <jwakely@redhat.com>
Mon, 18 Mar 2024 16:58:23 +0000 (16:58 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 7 Jun 2024 09:26:18 +0000 (10:26 +0100)
commit94997567ea5cbeb35571e94cf76d7f99ea3f9c43
treeabd7036e5416199e5adee3f84648aa3cafe9e04d
parente4f1c1be61d916345655d5edba309502046c9473
libstdc++: Optimize std::to_address

We can use if-constexpr and variable templates to simplify and optimize
std::to_address. This should compile faster (and run faster for -O0)
than dispatching to the pre-C++20 std::__to_address overloads.

libstdc++-v3/ChangeLog:

* include/bits/ptr_traits.h (to_address): Optimize.
* testsuite/20_util/to_address/1_neg.cc: Adjust dg-error text.
libstdc++-v3/include/bits/ptr_traits.h
libstdc++-v3/testsuite/20_util/to_address/1_neg.cc