mirror of
https://github.com/boostorg/coroutine2.git
synced 2025-05-09 23:24:01 +00:00
Merge pull request #47 from Lunar-YZ/Lunar-YZ-patch-1
Fixed the Stack unwinding doc error
This commit is contained in:
commit
5c2c914af1
@ -275,22 +275,22 @@ After unwinding, a __coro__ is complete.
|
|||||||
|
|
||||||
struct X {
|
struct X {
|
||||||
X(){
|
X(){
|
||||||
std::cout<<"X()"<<std::endl;
|
std::cout << "X()" << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
~X(){
|
~X(){
|
||||||
std::cout<<"~X()"<<std::endl;
|
std::cout << "~X()" << std::endl;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
{
|
{
|
||||||
typedef boost::coroutines2::coroutine<void>::push_type coro_t;
|
typedef boost::coroutines2::coroutine<void> coro_t;
|
||||||
|
|
||||||
coro_t::push_type sink(
|
coro_t::push_type sink(
|
||||||
[&](coro_t::pull_type& source){
|
[&](coro_t::pull_type& source){
|
||||||
X x;
|
X x;
|
||||||
for(int=0;;++i){
|
for(int i = 0; ; ++i){
|
||||||
std::cout<<"fn(): "<<i<<std::endl;
|
std::cout << "fn(): " << i << std::endl;
|
||||||
// transfer execution control back to main()
|
// transfer execution control back to main()
|
||||||
source();
|
source();
|
||||||
}
|
}
|
||||||
@ -312,7 +312,6 @@ After unwinding, a __coro__ is complete.
|
|||||||
fn(): 2
|
fn(): 2
|
||||||
fn(): 3
|
fn(): 3
|
||||||
fn(): 4
|
fn(): 4
|
||||||
fn(): 5
|
|
||||||
sink is complete: false
|
sink is complete: false
|
||||||
~X()
|
~X()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user