I wanted to track some options via bitmask'ing them, and borrowed bitmask values from this answer, yet they not seem to work together.
#include <iostream>
#define OP1 0x00003FFFUL
#define OP2 0x00007FFFUL
#define OP3 0x0000FFFFUL
int main() {
unsigned long params = 0; // .
params |= OP3;
if ( (params & OP1) == OP1)
std::cout << "Whoa. Lame masking\n";
}
Is it a type problem, or this method can't be used for holding more than 1 option at a time (both OP1, OP2 and OP3 are wanted to stay in same params
)?