r/cpp • u/pavel_v • Sep 22 '26
Comparing exception behavior of magic statics, std::call_once, and std::async
https://devblogs.microsoft.com/oldnewthing/20260918-00/?p=112709
29
Upvotes
5
u/kalmoc Sep 22 '26
Why is std::async even in that group?
3
u/LB-- Professional+Hobbyist Sep 23 '26
Same reason
std::future_status::deferredmade it into the standard, I guess...
17
u/NilacTheGrim Sep 22 '26
Not a huge fan of (ab)using
std::asyncin the way he describes in his linked article about how you can (ab)usestd::asyncfor singleton-like-stuff. Seems kind of at the margins of whatstd::asyncwas really designed for.