C++ Logo


Advanced search

Re: Coroutine: friendly STL support?

From: KL <deco33000_at_[hidden]>
Date: Mon, 11 Oct 2021 16:42:32 +0200
Ok, thanks for your very clear input. Appreciated.



16:09, 11 October 2021, Marcin Jaczewski <marcinjaczewski86@gmail.com>:

pon., 11 paź 2021 o 15:59 KL via Std-Discussion
<std-discussion@lists.isocpp.org> napisał(a):

 I see many of my algorithms that would take advantage of coroutines to better clarify my code.

 I love the simplicity of modern c++.

 But at the current state of affairs, I refrain from using coroutines because I feel that it is too verbose, error prone, and globally, a hassle to setup.

 As a parallel, I don't need to know how to implement the vector class to use it.

 I would like a high level, approachable way to define my function, and use co_xxx inside and be done with it, letting library/compiler to generate a default for me.

 Is it the future of the coroutines implementation (easy to use for developers that just want to think about algos running as fast as possible and not the nitty gritty implementation details) or will we be left with a lot of verbosity to make things work?

This is because current coroutine code is not for "users" but lib writers.
For now you need to check out some 3rd party implementations.

Reason why coroutine classes are not in standard is because defining
them correctly
to handle the maximum number of user cases is hard and will take a
couple of years of committee time.
Probably some of 3rd party implementations will become the foundation
for future std classes.

 This is in no way aggressive, I just need to know your point of view.


 Std-Discussion mailing list

Received on 2021-10-11 09:42:37