This question already has an answer here:
- Type safe enum bit flags 5 answers
enum status
{
b1 = 0,
b2 = 1 << 1,
b3 = 1 << 2
}
void findStatus(status flag)
{
// how do i check if flag has bit combination?
}
EXP : I would expect
findStatus(b1)
Not EXP :
findStatus(b2 | b3)
I need to check if the parameter has bit combined value passed or not?
Aucun commentaire:
Enregistrer un commentaire