Why std::atomic cannot call many functions in IAsyncAction methods (all of them look like writing functions)? #4273
-
Beta Was this translation helpful? Give feedback.
Answered by
DarranRowe
Mar 19, 2024
Replies: 1 comment 1 reply
-
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. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
sxlllslgh
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.