title: boost::coroutine2 vs CoroutineTS
body: <p>Boost::Coroutine2 and CoroutineTS(C++20) are popular coroutine implementations in C++. Both do suspend and resume but two implementations follow a quite different approaches.</p>
  
  <p><strong>CoroutineTS(C++20)</strong></p>
  
  <ul>
  <li>Stackless</li>
  <li>Suspend by return</li>
  <li>Uses special keywords</li>
  </ul>
  
  <pre><code>generator&lt;int&gt; Generate()
  {
     co_yield;
  });
  </code></pre>
  
  <p><strong>boost::coroutine2</strong></p>
  
  <ul>
  <li>Stackful</li>
  <li>Suspend by call</li>
  <li>Do not use special keywords</li>
  </ul>
  
  <pre><code>pull_type source([](push_type&amp; sink)
  {
     sink();
  });
  </code></pre>
  
  <p>Are there any specific use cases where I should select only one of them? </p>