Boost logo

Boost :

Subject: Re: [boost] Interest in bit-wise flags?
From: Jiří Havel (JSH_at_[hidden])
Date: 2014-06-18 04:01:09


Hello,

The syntax is quite messy, but it can be hidden. However I think, it is
too complicated and the same can be achieved in simpler way.

I personally use slightly modified flags from
http://sourceforge.net/projects/lordodinscpplib/ It is simple macro to
generate necessary operators for a scoped enum.

Unfortunately, this code requires C++11 and I am not sure if this can be
rewritten for older compilers. There is some implementation of scoped
enums in boost, so it may work.

But type safe flags are common enough to be part of boost. The
implementation details are just a matter of taste. I would use flags
from boost myself.

Jiří


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk