diff options
author | Tomasz Kamiński <tkaminsk@redhat.com> | 2025-03-24 18:04:28 +0100 |
---|---|---|
committer | Tomasz Kamiński <tkaminsk@redhat.com> | 2025-03-25 10:24:58 +0100 |
commit | 4d1b19695669e6c67b9c3df07673bc22cae3a662 (patch) | |
tree | f9c578ba3740a04a83c6751d3f4300c32731e517 /gcc | |
parent | 698e337bec3a36230c72816fcb82f1a239e64eba (diff) | |
download | gcc-4d1b19695669e6c67b9c3df07673bc22cae3a662.zip gcc-4d1b19695669e6c67b9c3df07673bc22cae3a662.tar.gz gcc-4d1b19695669e6c67b9c3df07673bc22cae3a662.tar.bz2 |
libstdc++: Fix handling of common cpp20-only ranges for flat sets [PR119415]
These patch add check to verify if common range iterators satisfies
Cpp17LegacyIterator requirements (__detail::__cpp17_input_iterator),
before invoking overloads of insert that accepts two iterators.
As such overloads existed before c++20 iterators were introduced,
they commonly assume existence of iterator_traits<..>::iterator_category,
and passing a cpp20-only iterators, leads to hard errors.
In case if user-defined container wants to support more efficient
insertion in such cases, it should provided insert_range method,
as in the case of standard containers.
PR libstdc++/119415
libstdc++-v3/ChangeLog:
* include/std/flat_set (_Flat_set_impl:insert_range):
Add __detail::__cpp17_input_iterator check.
* testsuite/23_containers/flat_multiset/1.cc: New tests
* testsuite/23_containers/flat_set/1.cc: New tests
Reviewed-by: Patrick Palka <ppalka@redhat.com>, Jonathan Wakely <jwakely@redhat.com>
Signed-off-by: Tomasz Kamiński <tkaminsk@redhat.com>
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions