cpp/atomic/atomic ref/fetch and

Atomically replaces the current value of the referenced object with the result of bitwise AND of the value and. This operation is a read-modify-write operation. Memory is affected according to the value of.

Return value
The value of the referenced object, immediately preceding the effects of this function.