Suppose we have followin declaration
enum visibility
{
On = 0,
Off = 1,
maxVisibility
};
Is the guaranteed value of maxVisibility
enumerator 2
in C++11/C++0x standard ?
Yes, it is guaranteed.
§ 7.2.2
If the first enumerator has no initializer,the value of the corresponding constant is zero. An enumerator-definition without an initializer gives the enumerator the value obtained by increasing the value of the previous enumerator by one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With