Boost logo

Boost :

From: Manuel Fiorelli (manuel.fiorelli_at_[hidden])
Date: 2007-06-11 13:15:13

your library sounds interesting to me, even if I have some questions:
1) what requirements the enumeration type should satisfy? For example, am I
obliged to declare
2's powers? such as
enum my_enum { flag1 = 1, flag2 = 2, flag3 = 4, ..... };

2) when you assign a value to a boost::flags<my_enum>, do you use my_enum
    It seems that flag1 | flag2 is an int, thus how can you distinguish
between flag1 | flag2 and another user provided integral constant. Do you
overload the "bitwise or" to produce an intermediate object???

3) I agree with you about the usefulness of such a library, since a compile
time check will assure that whenever the code is actually executed,
properties will be always in a sensible state (eliminating the annoying and
error prone runtime validation). If the programmer consider every notable
case, then a static checked flag will give us the same assurances which
could give us a collection of methods, one for each particular flag

Best regards,
Manuel Fiorelli

Boost list run by bdawes at, gregod at, cpdaniel at, john at