Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2005-06-25 07:05:19


>> 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.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk