]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Add noexcept-specifier to std::reference_wrapper::operator()
authorJonathan Wakely <jwakely@redhat.com>
Wed, 31 Aug 2022 12:57:34 +0000 (13:57 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 31 Aug 2022 13:28:03 +0000 (14:28 +0100)
commite47df5eb56c4e7aca0d3e50826e5aaa1887fa446
tree25b14958fc49244ee2578c1c393b0af81836aeaf
parent5d27fcd993e4519fc05224f48bd2492b6cf52be1
libstdc++: Add noexcept-specifier to std::reference_wrapper::operator()

This isn't required by the standard, but there's an LWG issue suggesting
to add it.

Also use __invoke_result instead of result_of, to match the spec in
recent standards.

libstdc++-v3/ChangeLog:

* include/bits/refwrap.h (reference_wrapper::operator()): Add
noexcept-specifier and use __invoke_result instead of result_of.
* testsuite/20_util/reference_wrapper/invoke-noexcept.cc: New test.
libstdc++-v3/include/bits/refwrap.h
libstdc++-v3/testsuite/20_util/reference_wrapper/invoke-noexcept.cc [new file with mode: 0644]