https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88996

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
+  inline constexpr memory_order
+  operator&(memory_order __m1, memory_order __m2)
+  { return memory_order(int(__m1) & int(__m2)); }
+
+  inline constexpr memory_order
+  operator|(memory_order __m1, memory_order __m2)
+  { return memory_order(int(__m1) | int(__m2)); }

What are these operators for? One of the main points of P0439 was that this
isn't a bitmask type, and combining the values doesn't make sense. Quoting the
paper:

> a scoped enumeration is more strongly typed, disallowing implicit
> conversion to integers, and preventing nonsensical expressions such as
> memory_order_acquire|memory_order_release (which could be mistakenly
> assumed to be equivalent to memory_order_acq_rel) or ~memory_order_relaxed.

Reply via email to