c++协程5(boost::coroutine2)

时间:2022-12-13 01:03:16
 

#include <iostream>
#include <cstdlib>


#include <boost/coroutine2/all.hpp>


int main()
{
int i = 0;
boost::coroutines2::coroutine< void >::push_type sink(
[&](boost::coroutines2::coroutine< void >::pull_type & source) {
std::cout << "inside coroutine-fn" << std::endl;
});
sink();


std::cout << "\nDone" << std::endl;


return EXIT_SUCCESS;

}

c++协程5(boost::coroutine2)