0

I would like to define an enum with different states that can be combined. I found that I could use bitset but I am not sure about how I can combine them.

So here is my enum :

enum Mode {
  NONE = 0,
  MODE_1 = 1 << 0,
  MODE_2 = 1 << 1,
  MODE_3 = 1 << 2
};

And what I want to do is to have a value that includes for instance mode_1 and mode_2.

klaus
  • 754
  • 8
  • 28

0 Answers0