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 {
X(){
std::cout<<"X()"<<std::endl;
std::cout << "X()" << std::endl;
}
~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::pull_type& source){
X x;
for(int=0;;++i){
std::cout<<"fn(): "<<i<<std::endl;
for(int i = 0; ; ++i){
std::cout << "fn(): " << i << std::endl;
// transfer execution control back to main()
source();
}
@ -312,7 +312,6 @@ After unwinding, a __coro__ is complete.
fn(): 2
fn(): 3
fn(): 4
fn(): 5
sink is complete: false
~X()