cmake CXX_HAS_COROUTINES examples

ned14/quickcpplib cmakelib/QuickCppLibUtils.cmake :581

check_cxx_source_compiles("
#include <initializer_list>
#if __has_include(<coroutine>) && (!defined(_MSC_VER) || _HAS_CXX20)
#include <coroutine>
using std::suspend_never;
#elif __has_include(<experimental/coroutine>)
#include <experimental/coroutine>
using std::experimental::suspend_never;
#endif
class resumable{
public:
  struct promise_type
  {
    resumable get_return_object() { return {}; }
    auto initial_suspend() { return suspend_never(); }
    auto final_suspend() noexcept { return suspend_never(); }
    void return_value(int) { }
    void unhandled_exception() {}
  };
  bool resume() { return true; }
  int get() { return 0; }
};
resumable g() { co_return 0; }
int main() { return g().get(); }
" CXX_HAS_COROUTINES${iter})