enums over static const unsigned variables by creating objects with them like so: |
|
|
|
1>Snippets.cpp(7): error C2675: unary '++' : 'eSuit' does not define this operator or a conversion to a type acceptable to the predefined operator 1>Snippets.cpp(8): error C2675: unary '++' : 'eVal' does not define this operator or a conversion to a type acceptable to the predefined operator |
|
|
1>Snippets.cpp(9): error C2665: 'cCard::cCard' : none of the 2 overloads could convert all the argument types 1> Snippets.cpp(31): could be 'cCard::cCard(eSuit,eVal)' 1> while trying to match the argument list '(unsigned int, unsigned int)' |
enums? Do I need to use the unsigned type and just cast it to the enum type when sticking it in my constructor? It works, but I was wondering if there was a more native way to do it. |
|
| Catfish2 (105) I wonder if ++static_cast<unsigned int> (suit) would work |
|
|
|
|
const int Constant(0), do not have memory allocated to them. Since each enumerator is assigned a magic constant by default, they won't have memory assigned to them. So how do you iterate through something that doesn't technically exist? Or have I got the wrong idea?enums and see how "clean" I can make it, although I see Framework's point regarding constants. Perhaps the "right" idea is to static_cast the enum to an unsigned when iterating.