> Have you read the post in question? Its a good introduction to C++ Concurrency / memory models.
Yes, I have. And yes, I am familiar with the C++ concurrency/memory models discussed here. And, to be clear, nothing in the article is doing anything that couldn't be done just as clearly with std::atomic<bool>& as with std::atomic<bool>*. Obviously, if you actually want to be able to assign to the pointer, then you need the pointer form.
> Indeed, one can argue that when using atomics, the more explicit "store" and "load" functions should be used instead.
Yes, this is the style I strongly prefer. Of course, here it doesn't matter between
a = blah->load();
blah->store(b);
or
a = blah.load();
blah.store(b);
and choosing to use the pointer form is often just introducing nullability where you don't need it.
Yes, I have. And yes, I am familiar with the C++ concurrency/memory models discussed here. And, to be clear, nothing in the article is doing anything that couldn't be done just as clearly with std::atomic<bool>& as with std::atomic<bool>*. Obviously, if you actually want to be able to assign to the pointer, then you need the pointer form.
> Indeed, one can argue that when using atomics, the more explicit "store" and "load" functions should be used instead.
Yes, this is the style I strongly prefer. Of course, here it doesn't matter between
or and choosing to use the pointer form is often just introducing nullability where you don't need it.