Created on 2022-08-27.00:00:00 last changed 13 months ago
Proposed resolution:
This wording is relative to n4917.
Modify [coro.generator.iterator] as indicated:
namespace std { template<class Ref, class V, class Allocator> class generator<Ref, V, Allocator>::iterator { public: using value_type = value; using difference_type = ptrdiff_t; iterator(iterator&& other) noexcept; iterator& operator=(iterator&& other) noexcept; reference operator*() const noexcept(is_nothrow_copy_constructible_v<reference>); iterator& operator++(); void operator++(int); friend bool operator==(const iterator& i, default_sentinel_t); private: coroutine_handle<promise_type> coroutine_; // exposition only }; }[…]
friend bool operator==(const iterator& i, default_sentinel_t);-10- Effects: Equivalent to: return i.coroutine_.done();
[ 2022-11-12 Approved at November 2022 meeting in Kona. Status changed: Voting → WP. ]
[ 2022-09-23; Reflector poll ]
Set status to Tentatively Ready after six votes in favour during reflector poll.
Currently, generator::iterator::operator== passes iterator by value. Given that iterator is a move-only type, this makes it impossible for generator to model range, since default_sentinel cannot be compared to the iterator of const lvalue and is not eligible to be its sentinel.
History | |||
---|---|---|---|
Date | User | Action | Args |
2023-11-22 15:47:43 | admin | set | status: wp -> c++23 |
2022-11-17 00:42:33 | admin | set | messages: + msg13069 |
2022-11-17 00:42:33 | admin | set | status: voting -> wp |
2022-11-08 03:46:49 | admin | set | status: ready -> voting |
2022-09-23 15:43:32 | admin | set | messages: + msg12788 |
2022-09-23 15:43:32 | admin | set | status: new -> ready |
2022-09-03 15:44:18 | admin | set | messages: + msg12732 |
2022-08-27 00:00:00 | admin | create |