coroutine2/example/simple.cpp
Oliver Kowalke fdf24a0607 rename of caputed_context to execution_context (v2)
- execution_context (v2) is enabled per default
- execution_context (v1) is enabled for property segmented-stacks=on
2016-02-06 12:37:50 +01:00

27 lines
642 B
C++

// Copyright Oliver Kowalke 2014.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include <cstdlib>
#include <iostream>
#include <boost/coroutine2/all.hpp>
using namespace boost::coroutines2;
asymmetric_coroutine<int>::pull_type make_dummy_range()
{
return asymmetric_coroutine<int>::pull_type([](asymmetric_coroutine<int>::push_type& yield)
{
yield(1);
});
}
int main() {
std::distance(make_dummy_range()); // error
std::cout << "Done" << std::endl;
return EXIT_SUCCESS;
}