aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2020-03-27 23:21:58 +0000
committerJonathan Wakely <jwakely@redhat.com>2020-03-27 23:26:01 +0000
commitae6076b5bc1e0b689eaa8521571b0516de336553 (patch)
treeb1f1845ab2180e4873036bb6d89ba93481a76d48 /gcc
parent0302a2de7f143bc4ac2a963761abc684b4dd6ddb (diff)
downloadgcc-ae6076b5bc1e0b689eaa8521571b0516de336553.zip
gcc-ae6076b5bc1e0b689eaa8521571b0516de336553.tar.gz
gcc-ae6076b5bc1e0b689eaa8521571b0516de336553.tar.bz2
libstdc++: Implement C++20 changes to insert iterators
std::insert_iterator and std::inserter need to be adjusted for C++20, so that they use ranges::iterator_t. That alias template requires ranges::begin to be defined. Rather than moving the whole of ranges::begin (and related details like ranges::enable_borrowed_range) into <iterator>, this defines a new, simpler version of ranges::begin that is sufficient for ranges::iterator_t to be defined. This works because ranges::iterator_t uses an lvalue reference type, so the logic in ranges::begin for non-lvalue ranges (i.e. borrowed ranges) isn't needed. This also adds the missing constexpr specifiers to the other insert iterators. * include/bits/iterator_concepts.h (__detail::__decay_copy) (__detail::__member_begin, __detail::__adl_begin): Move here from <bits/range_access.h>. (__detail::__ranges_begin, __detail::__range_iter_t): Define. * bits/range_access.h (__cust_access::__decay_copy) (__cust_access::__member_begin, __cust_access::__adl_begin): Move to <bits/iterator_concepts.h>. (ranges::iterator_t): Use __detail::__range_iter_t. * include/bits/stl_iterator.h (back_insert_iterator): Simplify conditional compilation. Add _GLIBCXX20_CONSTEXPR to all members. (front_insert_iterator): Likewise. (insert_iterator): Implement changes from P0896R4 for C++20. * testsuite/24_iterators/back_insert_iterator/constexpr.cc: New test. * testsuite/24_iterators/front_insert_iterator/constexpr.cc: New test. * testsuite/24_iterators/headers/iterator/synopsis_c++17.cc: Adjust for inclusion in synopsis_c++20.cc which expects different signatures for some function templates. * testsuite/24_iterators/insert_iterator/constexpr.cc: New test.
Diffstat (limited to 'gcc')
0 files changed, 0 insertions, 0 deletions