Merge pull request #47 from Lunar-YZ/Lunar-YZ-patch-1

Fixed the Stack unwinding doc error
This commit is contained in:
Oliver Kowalke 2024-01-02 09:13:18 +01:00 committed by GitHub
commit 5c2c914af1
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()