shared(int) val = 5; atomic_fetch_and_explicit_impl(&val, 3, memory_order.memory_order_seq_cst); assert(atomic_load_impl(&val) == 1);
See Implementation