mirror of
https://github.com/boostorg/coroutine.git
synced 2026-01-30 19:52:18 +00:00
pull_coroutine< void > - ctor changes
This commit is contained in:
@@ -14,21 +14,6 @@ import modules ;
|
||||
import os ;
|
||||
import toolset ;
|
||||
|
||||
if [ os.name ] = SOLARIS
|
||||
{
|
||||
lib socket ;
|
||||
lib nsl ;
|
||||
}
|
||||
else if [ os.name ] = NT
|
||||
{
|
||||
lib ws2_32 ;
|
||||
lib mswsock ;
|
||||
}
|
||||
else if [ os.name ] = HPUX
|
||||
{
|
||||
lib ipv6 ;
|
||||
}
|
||||
|
||||
project boost/coroutine/example
|
||||
: requirements
|
||||
<library>../../build//boost_coroutine
|
||||
@@ -40,42 +25,6 @@ project boost/coroutine/example
|
||||
<threading>multi
|
||||
;
|
||||
|
||||
exe segmented_stack
|
||||
: segmented_stack.cpp
|
||||
;
|
||||
|
||||
exe fibonacci
|
||||
: fibonacci.cpp
|
||||
;
|
||||
|
||||
exe echo
|
||||
: echo.cpp
|
||||
;
|
||||
|
||||
exe power
|
||||
: power.cpp
|
||||
;
|
||||
|
||||
exe parallel
|
||||
: parallel.cpp
|
||||
;
|
||||
|
||||
exe unwind
|
||||
: unwind.cpp
|
||||
;
|
||||
|
||||
exe same_fringe
|
||||
: same_fringe.cpp
|
||||
;
|
||||
|
||||
exe layout
|
||||
: layout.cpp
|
||||
;
|
||||
|
||||
exe chaining
|
||||
: chaining.cpp
|
||||
;
|
||||
|
||||
exe exception
|
||||
: exception.cpp
|
||||
exe simple
|
||||
: simple.cpp
|
||||
;
|
||||
|
||||
37
example/cpp03/simple.cpp
Normal file
37
example/cpp03/simple.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
// Copyright Oliver Kowalke 2009.
|
||||
// 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/bind.hpp>
|
||||
#include <boost/coroutine/all.hpp>
|
||||
|
||||
typedef boost::coroutines::coroutine< void >::pull_type pull_coro_t;
|
||||
typedef boost::coroutines::coroutine< void >::push_type push_coro_t;
|
||||
|
||||
void runit( push_coro_t & sink)
|
||||
{
|
||||
std::cout << "started! ";
|
||||
for ( int i = 0; i < 10; ++i)
|
||||
{
|
||||
sink();
|
||||
}
|
||||
}
|
||||
|
||||
int main( int argc, char * argv[])
|
||||
{
|
||||
{
|
||||
pull_coro_t source( runit);
|
||||
while ( source) {
|
||||
source();
|
||||
}
|
||||
}
|
||||
|
||||
std::cout << "\nDone" << std::endl;
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
Reference in New Issue
Block a user