add test regarding to multiple definition

This commit is contained in:
Oliver Kowalke
2014-08-21 16:53:53 +02:00
parent 552c0282ba
commit 8a5e77dc8b
2 changed files with 33 additions and 0 deletions

View File

@@ -60,6 +60,7 @@ exe segmented_stack
;
exe simple
: simple.cpp
test.cpp
;
exe unwind
: unwind.cpp

View File

@@ -0,0 +1,32 @@
#include <boost/coroutine/all.hpp>
typedef boost::coroutines::asymmetric_coroutine< void >::pull_type pull_coro_t;
typedef boost::coroutines::asymmetric_coroutine< void >::push_type push_coro_t;
void foo1( push_coro_t & sink)
{
for ( int i = 0; i < 10; ++i)
sink();
}
void foo2( pull_coro_t & source)
{
while ( source)
source();
}
void bar()
{
{
pull_coro_t source( foo1);
while ( source) {
source();
}
}
{
push_coro_t sink( foo2);
for ( int i = 0; i < 10; ++i)
sink();
}
}