
15 Jun
2025
15 Jun
'25
11:24 p.m.
On 11 Jun 2025 02:34, Andrey Semashev wrote:
Hi,
There were quite a few times when I wanted to use bitwise operations on atomic<enum>, where the enum lists a number of flags that could be combined with bitwise AND, OR and XOR. Neither std::atomic nor Boost.Atomic enables bitwise operations for enums, so I had to resort to workarounds, such as using atomic<underlying_type_t<enum>> with explicit casts to and from the underlying type of the enum. Obviously, this is rather tedious, and I would prefer not to have to do this.
I have now implemented this in Boost.Atomic. I will be shipped in the next Boost release.