
25 Jun
2005
25 Jun
'05
12:05 p.m.
Still trying to understand what this ones for... John.
Well, if it's not performance then it's a size of application ;) If some function template treats enumerations as numeric then converting all enums to promoted types reduces number of instantiated functions. Typical example is integer to string conversion.
OK, that's reasonable.
BTW, why promotions exist in C/C++?
If you search the std for (4.5) you'll find: Prior to applying a binary operator to two integer types. When accessing the value of an enum. When evaluating an integral non-type template argument. When passing an integral type through ellipsis in a function call. John.