adapt new execution_context API

This commit is contained in:
Oliver Kowalke
2015-11-10 20:02:33 +01:00
parent fe869dd847
commit 4bb8f7585f
22 changed files with 501 additions and 544 deletions

View File

@@ -9,26 +9,22 @@
#include <boost/coroutine2/all.hpp>
int main()
{
int main() {
boost::coroutines2::coroutine< int >::pull_type source(
[&]( boost::coroutines2::coroutine< int >::push_type & sink) {
[]( boost::coroutines2::coroutine< int >::push_type & sink) {
int first = 1, second = 1;
sink( first);
sink( second);
for ( int i = 0; i < 8; ++i)
{
for ( int i = 0; i < 8; ++i) {
int third = first + second;
first = second;
second = third;
sink( third);
}
});
for ( auto i : source)
for ( auto i : source) {
std::cout << i << " ";
}
std::cout << "\nDone" << std::endl;
return EXIT_SUCCESS;
}