What is the range of a c++ enum with a constant expression? This is my code
#include <iostream>
int main(){
enum e3{min = -10, max = 100000};
e3 x = e3(-1000);
e3 y= e3(-100000912241);
std::cout<<x<<" "<<y<<std::endl;
}
It outputs -1000 -1216664433
How is this happening?
Also, The C++ programming language by Bjarne Stroustrup
specifies that the result of conversion of integral type to enumeration is undefined unless the value is the within the range of the enumeration. What is this range and how to calculate it?