Skip to content

Why std::atomic cannot call many functions in IAsyncAction methods (all of them look like writing functions)? #4273

Answered by DarranRowe
sxlllslgh asked this question in Q&A
Discussion options

You must be logged in to vote

Well, I would guess that the missing store is due to the fact that the function parameter is const. The const marks the entire Foo as constant, and the store modifies the flag member of Foo. This can't happen.
As long as you don't modify the vector until after all of the co routines return, then you don't need the const.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@sxlllslgh
Comment options

Answer selected by sxlllslgh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants