diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2023-11-26 21:32:35 +0000 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2023-12-05 23:34:12 +0000 |
commit | 45630fbcf7875b5e78c74ff4fb35cc09cd2e4e9b (patch) | |
tree | 146f8e00c9f8cc73f8a8c2db4c01fcf2767f7241 /gcc/testsuite/c-c++-common/strub-strict1.c | |
parent | 5e8a30d8b8f4d7ea0a8340b46c1e0c865dbde781 (diff) | |
download | gcc-45630fbcf7875b5e78c74ff4fb35cc09cd2e4e9b.zip gcc-45630fbcf7875b5e78c74ff4fb35cc09cd2e4e9b.tar.gz gcc-45630fbcf7875b5e78c74ff4fb35cc09cd2e4e9b.tar.bz2 |
libstdc++: Implement LWG 4016 for std::ranges::to
This implements the proposed resolution of LWG 4016, so that
std::ranges::to does not use std::back_inserter and std::inserter.
Instead it inserts at the back of the container directly, using
the first supported one of emplace_back, push_back, emplace, and insert.
Using emplace avoids creating a temporary that has to be moved into the
container, for cases where the source range and the destination
container do not have the same value type.
libstdc++-v3/ChangeLog:
* include/std/ranges (__detail::__container_insertable): Remove.
(__detail::__container_inserter): Remove.
(ranges::to): Use emplace_back or emplace, as per LWG 4016.
* testsuite/std/ranges/conv/1.cc (Cont4, test_2_1_4): Check for
use of emplace_back and emplace.
Diffstat (limited to 'gcc/testsuite/c-c++-common/strub-strict1.c')
0 files changed, 0 insertions, 0 deletions