C++26 introduces fetch_max and fetch_min operations for atomic types, supporting integral, pointer, and floating-point types. These operations atomically compare and update values, performing std::max/min between an argument and the atomic object's current value while returning the previous value. The feature, originally proposed in 2016 and revived in 2020, enables use cases like atomic queue implementations and high-performance concurrent operations, with benchmarks showing significant throughput improvements on multi-threaded systems including GPU architectures with up to 130,000 hardware threads.
Sort: