A class:
class foo{ public: int data; };
Now I want to add a method to this class, to do some comparison, to see if its data is equal to on
If data is really an integral or enumerated type, you can use a switch:
data
switch
switch (data) { case 1: case 2: case 2000: case 6000: case /* whatever other values you want */: act_on_the_group(); break; default: act_on_not_the_group(); break; }