Seems to me that someone has not quite understood how to avoid casting
when working with enums.
First: whenevery you have to use a cast you should think: "Something fishy is going
on, how can I avoid this."
Remember also when working with enums: c++ can overload operators so
that:
enum Button { one, two three };
inline Button operator|(Button a, Button b) {
return Button(a | b);
}
Button all = one | two | three;
will compile without warning, anoter option in this case is to use a
more special kind of "cast":
Button all = Button(one | two | three);
I have removed all casts from ButtonPolicies + changed what Angus did
you work around wrong use of casts. (casting a enum val to a ref to
int is _bad_)
Please try it out.
Lgb