Le 2025-11-18 12:08, Dmitry Arkhipov via Boost a écrit :
В письме от вторник, 18 ноября 2025 г. 13:46:22 MSK пользователь Janko Dedic via Boost написал:
enum class E { A, B, C }; flag_set<E> flags{E::A, E::B}; flags.add(E::C); flags.erase(E::A); bool b = flags.contains(E::B);
There was recently (last year?) a library author seeking for endorsements for a library like that. To my knowledge, he didn't get a single one. Seems to me that people in general think that wrapping the bitmask with a struct is too much.
Are you speaking of https://lists.boost.org/archives/list/boost@lists.boost.org/thread/EZXQFJWA5... ? It did receive some positive feedback. But the approach was not the one proposed by Janko. And i'm starting to consider the flag_set approach to be a far superior one. bit flags are not a value per se, they are a set of values, and they deserve to be treated as such. Regards, Julien