Sorry if this has been asked before. I have always struggled with the concept of flags, even those I use them on occasion.
Take this enum
:
enum ImportAssignment
{
None = 0,
OCLMHost = 1 << 0,
OCLMCohost = 1 << 1,
OCLMZoomAttendant = 1 << 2,
OCLMChairman = 1 << 3,
OCLMOpenPrayer = 1 << 4,
OCLMClosePrayer = 1 << 5,
OCLMConductorCBS = 1 << 6,
OCLMReaderCBS = 1 << 7,
PTHost = 1 << 8,
PTCohost = 1 << 9,
PTZoomAttendant = 1 << 10,
PTChairman = 1 << 11,
PTHospitality = 1 << 12,
WTConductor = 1 << 13,
WTReader = 1 << 14,
PTSpeaker = 1 << 15,
PTTheme = 1 << 16
};
What would be the largest value I can use here? As in 1 << nn
? What maximum value and nn
be and why is it that value?
The suggested duplicate:
What is the underlying type of a c++ enum?
Appears to only explain that the underlying variable type of an enum
is an int
. I already know this. But I still don't really know how large the nn
value can be and I do not see how the linked question addresses that.