std::atomic Compare-Exchange
What does compare_exchange_strong return if the comparison fails?
std::atomic<int> counter{5};
int expected = 10;
bool result = counter.compare_exchange_strong(expected, 20);
Sign in to answer questions and track your progress
Sign In