Enum "Inheritance"?

Nick Sabalausky a at a.a
Thu Feb 24 18:01:37 PST 2011


"%u" <wfunction at hotmail.com> wrote in message 
news:ik70pq$1a37$1 at digitalmars.com...
>>> Lol, okay. Do you have any other suggestions for a better
> solution on how to avoid duplicating generic access masks like
> MAXIMUM_ALLOWED inside each access mask type?
>
>> You're doing it wrong. Create OO wrapper instead.
>
> Hm... but:
>
> (1) I'm not going to create a new instance of an entire class every
> single time I need to check an access mask, that's wasteful. When
> was the last time you created a "new int()" on the stack and all you
> did was pass the dereferenced value to a function?
>
> (2) A singleton pattern won't really work with bitwise OR, unless I
> instantiate a new access mask object at each call, in which case we
> go back to point (1).
>
> Any other ways? Or am I misunderstanding this?

What exactly is it that you're trying to do?





More information about the Digitalmars-d mailing list