yyzybb537 / libgo

Go-style concurrency in C++11
MIT License
3.22k stars 758 forks source link

co_defer 有问题 #194

Closed CenJieTeng closed 4 years ago

CenJieTeng commented 5 years ago
for (int i = 0; i >= 0; --i)
    co_defer [&] {cout << "defer 0" <<   endl; };

int i = 1;
while (i--)
   co_defer [&] {cout << "defer 0" <<   endl; };

co_defer [&] {cout << "defer 0" <<   endl; };

在循环里和不在循环里 运行结果不一致