what this code means ?

hi ! ^^

I am starting to learn C++ these days..

but I can not understand codes below..

This code is builded with no problem..

But I can not understand the meaning...

1
2
3
4
5
6
7
enum class PhysicalCategory { // why not just use 'void' ...? why enum type?
  None = 0, // what?? no type ?? what is comma ',' means ? 
  Monster = (1 << 0), // what?? what is ( 1<< 0) ?
  Misile = (1 << 1), 
  All = PhysicalCategory::Monster | PhysicalCategory::Misile
  // what is going on? what '|' means?
};


My question is with '//' comment ...
Sorry for many questions ..

Thanks in advance ^ ^
Last edited on
Last edited on
Besides that this is an enum Class as mentioned there's nothing confusing about any of that code. The symbols are all just basic C++ operators. If you don't understand them go study them: http://www.cplusplus.com/doc/tutorial/operators/
Topic archived. No new replies allowed.