#pragma once #include struct test_delay final : public asyncpp::base_future { public: using value_type = int&; using this_type = test_delay; using base_future_type = base_future; using result_type = typename base_future_type::result_type; public: int const _delay { 5 }; int _count { 0 }; public: test_delay(int p_delay, int p_count) : _delay(p_delay) , _count(p_count) { } inline result_type poll() { if (_count >= _delay) return result_type::ready(_count); ++_count; return result_type::not_ready(); } };