Fixed the Stack unwinding doc error

This commit is contained in:
Lunar-YZ 2024-01-02 10:29:07 +08:00 committed by GitHub
parent d7e1c1c4ab
commit 0734aa18c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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()