using enums for flags

Simen Kjærås simen.kjaras at gmail.com
Wed Jan 25 14:47:18 PST 2012


On Wed, 25 Jan 2012 22:47:49 +0100, Trass3r <un at known.com> wrote:

>>> Does it really make sense to allow bitwise operations on different  
>>> enums?
>> Maybe. Certainly sometimes
> Examples please.

In the codebase I have to work with, having the same enum specified in
different places is rather common. Yeah, I hate it. This means I might
have a filter defined using one enum, and the value to filter being a
different type with the same values.


>> but those could just as easily use casts.
>
> Seconded.
>
> I generally don't see any merit in letting enums *implicitly* convert to  
> their base type.


More information about the Digitalmars-d mailing list