Scott Meyers
2009-11-24 20:38:16 UTC
These types seem to have almost identical interfaces. The only
difference I see (in terms of functions that may be called -- I didn't
check the semantics of the functions) is that std::atomic<bool> offers
bool operator=(bool);
and std::atomic_bool does not. (It almost offers that function, but
it's volatile-qualified.)
Can somebody please explain why we need std::atomic_bool instead of
just using std::atomic<bool>?
Thanks,
Scott
difference I see (in terms of functions that may be called -- I didn't
check the semantics of the functions) is that std::atomic<bool> offers
bool operator=(bool);
and std::atomic_bool does not. (It almost offers that function, but
it's volatile-qualified.)
Can somebody please explain why we need std::atomic_bool instead of
just using std::atomic<bool>?
Thanks,
Scott
--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]