template inline Iterator::Iterator(Handle handle) noexcept : d_coHandle(handle) {} template Iterator &Iterator::operator++() { d_coHandle.resume(); if (d_coHandle.done()) { d_coHandle.promise().rethrow_if_exception(); } return *this; } template inline typename Promise::Reference Iterator::operator*() const noexcept { return d_coHandle.promise().value(); } template inline typename Promise::Value *Iterator::operator->() const noexcept { return std::addressof(operator*()); } // Need to provide post-increment operator to implement the 'Range' concept. template inline void Iterator::operator++(int) { operator++(); } template inline bool operator==(Iterator const &it, Sentinel) noexcept { return not it.d_coHandle or it.d_coHandle.done(); } template inline bool operator!=(Iterator const &it, Sentinel s) noexcept { return not (it == s); } template inline bool operator==(Sentinel s, Iterator const &it) noexcept { return it == s; } template inline bool operator!=(Sentinel s, Iterator const &it) noexcept { return it != s; }