[C++-sig] Bitflags

M. Evans datafeed at SoftHome.net
Sat Dec 14 20:19:41 CET 2002


> No... what I meant by flags was:
> 
> enum Fu { x = 1, y = 2, z = 4 };
> 
> Fu combined = x | y | z;

Commonly called "bitflags," and in my book, deprecated -- though I have
used them extensively.  Their main advantage is syntactical.  I don't
know the context here precisely, but bitflags make combinations of
"rules" or "options" easy to write.

The problem is the limitation thus imposed on the number of possible
options (e..g 16 or 32).

Mark





More information about the Cplusplus-sig mailing list