2
enum class color {
    red,
    black,
    white,
    yellow,
    green,
    blue,
};
color c;
if(c == color::red && c == color::black || c == color::green -etc.)

The last statement is too fussy,is there any better way to do it like if(c in(color::red,color::black,color::green))?

Y.Lex
  • 241
  • 1
  • 7
  • [This](https://stackoverflow.com/a/15181949/7699037) might help – Mike van Dyke Jul 31 '18 at 07:01
  • I don't think this is a duplicate as an enum class is not just a bunch of values... anyways you could just do if(c >= color::red && c <= color::blue) Or add some kind of begin/end values like here: https://godbolt.org/g/kFgSVR – TomSmartBishop Jul 31 '18 at 08:47

0 Answers0