#include <iostream>
#include <limits>
enum Colors { YELLOW = 10, ORANGE };
enum BigValue {
VALUE = std::numeric_limits<long>::max()
};
enum RgbColors : unsigned int {
RED = 0x01,
GREEN = 0x02,
BLUE = 0x04,
// BLACK = 0xFF + 1 // error: enumerator value 256 is outside the range
// of underlying type ‘unsigned char’
};
int main() {
std::cout << sizeof(Colors) << std::endl; // 4 - sizeof(int)
std::cout << sizeof(BigValue) << std::endl; // 8 - sizeof(long)
std::cout << sizeof(RgbColors) << std::endl; // 1- size(unsigned char)
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8bGltaXRzPgoKZW51bSBDb2xvcnMgeyBZRUxMT1cgPSAxMCwgT1JBTkdFIH07CmVudW0gQmlnVmFsdWUgewogICAgVkFMVUUgPSBzdGQ6Om51bWVyaWNfbGltaXRzPGxvbmc+OjptYXgoKQp9OwplbnVtIFJnYkNvbG9ycyA6IHVuc2lnbmVkIGludCB7CiAgICBSRUQgPSAweDAxLAogICAgR1JFRU4gPSAweDAyLAogICAgQkxVRSA9IDB4MDQsCiAgICAvLyBCTEFDSyA9IDB4RkYgKyAxICAvLyBlcnJvcjogZW51bWVyYXRvciB2YWx1ZSAyNTYgaXMgb3V0c2lkZSB0aGUgcmFuZ2UKICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG9mIHVuZGVybHlpbmcgdHlwZSDigJh1bnNpZ25lZCBjaGFy4oCZCn07CgppbnQgbWFpbigpIHsKCXN0ZDo6Y291dCA8PCBzaXplb2YoQ29sb3JzKSA8PCBzdGQ6OmVuZGw7ICAgIC8vIDQgLSBzaXplb2YoaW50KQoJc3RkOjpjb3V0IDw8IHNpemVvZihCaWdWYWx1ZSkgPDwgc3RkOjplbmRsOyAgLy8gOCAtIHNpemVvZihsb25nKQoJc3RkOjpjb3V0IDw8IHNpemVvZihSZ2JDb2xvcnMpIDw8IHN0ZDo6ZW5kbDsgLy8gMS0gc2l6ZSh1bnNpZ25lZCBjaGFyKQoJcmV0dXJuIDA7Cn0=