Suppose that I code this:
enum State{
State0, //=0
State1, //=1
State2, //=2
State5 = State2+3, //=5
State6 = State5+1, //=6
StateSize = State6+1 //=7
};
How much can I rely on the fact (e.g. StateSize==7
)?
More specifically, what is the C++ law/rule to determine what are the values of them?
I feel that there might be a question about this in SO, but I can't find it.