std::atomic<int> - load and reset to 0 atomically?
<p>Having <code>std::atomic&lt;int&gt;</code> how can I atomically load value and reset to <code>0</code>? So If I do this operation from two threads, only one receive value, another should receive <code>0</code>.</p>