Bitwise Operations on enums having more than 64 values
I am new to cocoa and enums , I have more than 64 values in a enum. I have
to perform bitwise & and OR on it.
For Eg: (Assume that this enum has more than 64 values) enum { apple = 0,
orange, pineapple, grapes, .. ... ... }
I have a list of items in a dictionary say , Required Fruits =
{apple,pineapple} I have to get the fruit which is being currently used
and check if it appears in the Required Fruits list , say if I have a
value apple I have to check if apple is in Required Fruits.
And all this has to be performed using a bitwise operation. (apple |
pineapple ) & apple
But I have more than 64 values in the enum. Can bitwise operation be
performed on enums having more than 64 values ? Please help me on this.Any
information on this will be of great help.
No comments:
Post a Comment