matthiasm wrote:

> My question to you then is: is it a good idea to convert all enums that 
> are not used as true enumerations (pretty much all of them) from
> 
>  > enum Fl_Align {
>  >   FL_ALIGN_LEFT = 4,
>  >   FL_ALIGN_INSIDE = 16, ...
> 
> to something like this:
> 
>  > typedef unsigned short Fl_Align;
>  > const Fl_Align FL_ALIGN_LEFT   = 4;
>  > const Fl_Align FL_ALIGN_INSIDE = 16;

You would not gain any safety with that, it seems to me both approaches 
are more-less equivalent so I would not bother with the changes. There 
is a possibility to define an "enumeration" class and overload useful 
operators, but this would introduce unnecessary bloat, my opinion it is 
not worth the effort. Typesafety helps but does not assure that your 
construct is correct, ie what would be the meaning
(assuming the result would be of correct type) of
FL_ALIGN_LEFT|FL_ALIGN_RIGHT ?

R.
_______________________________________________
fltk-dev mailing list
fltk-dev@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk-dev

Reply via email to