#ifndef INCLUDED_ITERATOR_H_ #define INCLUDED_ITERATOR_H_ // needs the Promise header (generatorpromise.h) template class Iterator; template bool operator==(Iterator const &it, Sentinel) noexcept; template class Iterator { friend bool operator==<>(Iterator const &it, Sentinel) noexcept; using Handle = std::coroutine_handle>; Handle d_coHandle = 0; public: Iterator() noexcept = default; explicit Iterator(Handle handle) noexcept; // Need the post-increment operator for the 'Range' concept. void operator++(int); Iterator &operator++(); typename Promise::Reference operator*() const noexcept; typename Promise::Value *operator->() const noexcept; }; #include "iterator.imp" #endif