C++ Logo

std-discussion

Advanced search

Re: Coroutine: friendly STL support?

From: Marcin Jaczewski <marcinjaczewski86_at_[hidden]>
Date: Mon, 11 Oct 2021 16:09:29 +0200
pon., 11 paź 2021 o 15:59 KL via Std-Discussion
<std-discussion_at_[hidden]> napisał(a):
>
> Hello,
> 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.
>
> Thanks
>
> --
> --
> Std-Discussion mailing list
> Std-Discussion_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-discussion

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