4 ms·
My impression is that coroutines aren't super stable today, but what you're seeing there is a C++20 "concept", essentially, a way to restrict the types accepted
by foota 3y ago
My impression is that coroutines aren't super stable today, but what you're seeing there is a C++20 "concept", essentially, a way to restrict the types accepted by a template. E.g., the is_task part is a concept that requires the template parameter type task_t to meet some criteria.
Normal template code looks like:
template <typename T>
Where you can also choose to use the class keyword instead of typename.
C++20 isn't very widely used though, so this isn't something you're likely to run into in anything other than cutting edge code. If you want you can read about them here: https://en.cppreference.com/w/cpp/language/constraints https://en.cppreference.com/w/cpp/language/constraints but you're probably better not using concepts at least at first. In general, https://en.cppreference.com/ https://en.cppreference.com/ is a very high quality source for learning, although it's very dry as well.