On 31 Aug 2000, Lars Gullik Bjønnes wrote:

> Seems to me that someone has not quite understood how to avoid casting
> when working with enums.
> 
> First: whenever you have to use a cast you should think: "Something
> fishy is going on, how can I avoid this."

That's what I was thinking.  I was also concerned why Dekel was getting
the warnings he was so we had some private discussions.  I was more
concerned with why he was getting warnings and I couldn't with any
compiler I have no matter what flags I used.  Although I can get a warning
from 2.95.2 when using -pedantic, complaining about using SMI_TOTAL where
it wants an integer.  Maybe that should be ButtonPolicy::SMI_TOTAL
instead?

> I have removed all casts from ButtonPolicies + changed what Angus did
> you work around wrong use of casts.

Thanks.  This looks more sensible.

> (casting a enum val to a ref to int is _bad_)

Definitely agree here.

Allan. (ARRae)

Reply via email to