coroutine: coroutine_error + coroutine_errc

[SVN r85139]
This commit is contained in:
Oliver Kowalke
2013-07-23 19:49:38 +00:00
parent 01235d2ee7
commit 4c4f2afbd5
20 changed files with 279 additions and 71 deletions

View File

@@ -12,21 +12,21 @@
#ifdef BOOST_COROUTINES_UNIDIRECT
int main()
{
boost::coroutines::coroutine< int >::pull_type c(
[&]( boost::coroutines::coroutine< int >::push_type & c) {
boost::coroutines::coroutine< int >::pull_type source(
[&]( boost::coroutines::coroutine< int >::push_type & sink) {
int first = 1, second = 1;
c( first);
c( second);
sink( first);
sink( second);
for ( int i = 0; i < 8; ++i)
{
int third = first + second;
first = second;
second = third;
c( third);
sink( third);
}
});
for ( auto i : c)
for ( auto i : source)
std::cout << i << " ";
std::cout << "\nDone" << std::endl;