]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Non-triv-copyable extra args aren't simple [PR100940]
authorPatrick Palka <ppalka@redhat.com>
Thu, 17 Jun 2021 13:46:07 +0000 (09:46 -0400)
committerPatrick Palka <ppalka@redhat.com>
Fri, 18 Jun 2021 02:55:34 +0000 (22:55 -0400)
commitf0d8d001d94166242be4387ca72fe0fc483860f1
tree360ccfc10421655e1d6915df2fe34611085f8181
parentbc7a522548c37daf612c2ba4c44e9ea93548ed45
libstdc++: Non-triv-copyable extra args aren't simple [PR100940]

This force-enables perfect forwarding call wrapper semantics whenever
the extra arguments of a partially applied range adaptor aren't all
trivially copyable, so as to avoid incurring unnecessary copies of
potentially expensive-to-copy objects (such as std::function objects)
when invoking the adaptor.

PR libstdc++/100940

libstdc++-v3/ChangeLog:

* include/std/ranges (__adaptor::_Partial): For the "simple"
forwarding partial specializations, also require that
the extra arguments are trivially copyable.
* testsuite/std/ranges/adaptors/100577.cc (test04): New test.

(cherry picked from commit 2b87f3318cf6334a3a42dcf27f2fdec0fce04665)
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/adaptors/100577.cc