launch::dispatch test program in Boost.Fibers

launch::dispatch test program in Boost.Fibers

When working with Boost.Fibers, we often need to launch functions using launch::dispatch. So how to test a program that uses launch::dispatch? This article will provide a simple test program, and attach the source code.

The function of the test program is very simple: start a coroutine and output a string. First, we need to import the header file:

#include <boost/fiber/all.hpp>

Then, define the output function:

void output(const std::string& str)
{
   
    
    
    boost::this_fib

Guess you like

Origin blog.csdn.net/qq_39605374/article/details/132285660