3 ms·
What do you think of C++ coroutines? Two competing standards proposals, already available as libraries: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015
by acconsta 11y ago
What do you think of C++ coroutines? Two competing standards proposals, already available as libraries:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4453.pdf http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n445...
http://blogs.msdn.com/b/vcblog/archive/2014/11/12/resumable-functions-in-c.aspx http://blogs.msdn.com/b/vcblog/archive/2014/11/12/resumable-...
- pmjordan 11y agoThey certainly look useful at first glance. The first's library implementation is based on boost.coroutine which as far as I'm aware uses stack-switching, so this is more of a syntax demo than a demo of the final implementation details. The fact that you can apply sizeof() to the resumable type is important for the kernel-typical pool allocators. The second seems to have preview support in VS2015's compiler. Too bad I'm not much of a Windows programmer these days… It's not quite clear what ther memory-allocation story is from that article. Of course the downside is it's yet another graft onto the C++ language. After ~15 years of using it, my point of view is mainly that C++'s type system and unsafe-by-default behaviour inherited from C are a mistake…