libstdc++: Fix noexcept guarantees for ranges::split_view
authorJonathan Wakely <jwakely@redhat.com>
Tue, 10 Mar 2020 17:45:45 +0000 (17:45 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Tue, 10 Mar 2020 17:45:45 +0000 (17:45 +0000)
commitcf0c3a457319df1e8dc9321227162a7c57169a39
tree3f8e81404bd8e6cd621aa4b87e25e74d5da9e1f5
parentb888a051deb7df7587acbe8865513b86d2a1d49f
libstdc++: Fix noexcept guarantees for ranges::split_view

Also introduce the _M_i_current() accessors to solve the problem of
access to the private member of _OuterIter from the iter_move and
iter_swap overloads (which are only friends of _InnerIter not
_OuterIter).

* include/std/ranges (transform_view::_Iterator::__iter_move): Remove.
(transform_view::_Iterator::operator*): Add noexcept-specifier.
(transform_view::_Iterator::iter_move): Inline __iter_move body here.
(split_view::_OuterIter::__current): Add noexcept.
(split_view::_InnerIter::__iter_swap): Remove.
(split_view::_InnerIter::__iter_move): Remove.
(split_view::_InnerIter::_M_i_current): New accessors.
(split_view::_InnerIter::__at_end): Use _M_i_current().
(split_view::_InnerIter::operator*): Likewise.
(split_view::_InnerIter::operator++): Likewise.
(iter_move(const _InnerIter&)): Likewise.
(iter_swap(const _InnerIter&, const _InnerIter&)): Likewise.
* testsuite/std/ranges/adaptors/split.cc: Check noexcept-specifier
for iter_move and iter_swap on split_view's inner iterator.
libstdc++-v3/ChangeLog
libstdc++-v3/include/std/ranges
libstdc++-v3/testsuite/std/ranges/adaptors/split.cc