Created on 2021-10-12.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to N4892.
Modify [range.transform.iterator], class template transform_view::iterator, as indicated:
[…] constexpr decltype(auto) operator*() const noexcept(noexcept(invoke(*parent_->fun_, *current_))) { return invoke(*parent_->fun_, *current_); } […]friend constexpr decltype(auto) iter_move(const iterator& i) noexcept(noexcept(invoke(*i.parent_->fun_, *i.current_))) { if constexpr (is_lvalue_reference_v<decltype(*i)>) return std::move(*i); else return *i; }[…]
[ 2022-02-10 Approved at February 2022 virtual plenary. Status changed: Tentatively Ready → WP. ]
[ 2022-01-29; Reflector poll ]
Set status to Tentatively Ready after seven votes in favour during reflector poll.
transform_view's iterator currently specifies a customization point for iter_move. This customization point does the same thing that the default implementation would do — std::move(*E) if *E is an lvalue, else *E — except that it is only there to provide the correct conditional noexcept specification. But for iota_view, we instead provide a noexcept-specifier on the iterator's operator*. We should do the same thing for both, and the simplest thing would be:
Change [range.transform.iterator] to put the whole body into noexcept:constexpr decltype(auto) operator*() const noexcept(noexcept(invoke(*parent_->fun_, *current_))) { return invoke(*parent_->fun_, *current_); }
And to remove this:
friend constexpr decltype(auto) iter_move(const iterator& i) noexcept(noexcept(invoke(*i.parent_->fun_, *i.current_))) { if constexpr (is_lvalue_reference_v<decltype(*i)>) return std::move(*i); else return *i; }
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2022-02-10 12:58:57 | admin | set | messages: + msg12354 |
2022-02-10 12:58:57 | admin | set | status: ready -> wp |
2022-01-29 22:29:12 | admin | set | messages: + msg12286 |
2022-01-29 22:29:12 | admin | set | status: new -> ready |
2021-10-17 10:48:28 | admin | set | messages: + msg12173 |
2021-10-12 00:00:00 | admin | create |