| Home | Libraries | People | FAQ | More

### integral_promotion

    template <class T>
    struct integral_promotion
    {
       typedef see-below type;
    };

    template <class T> using integral_promotion_t = typename integral_promotion<T>::type; // C++11 and above

type: If integral promotion can be applied to an rvalue of type `T`, then applies integral promotion to `T` and keeps cv-qualifiers of `T`, otherwise leaves `T` unchanged.

C++ Standard Reference: 4.5 except 4.5/3 (integral bit-field).

Header: `#include <boost/type_traits/integral_promotion.hpp>` or `#include <boost/type_traits.hpp>`

Table 1.24. Examples

Expression | Result Type
--- | ---
`integral_promotion<short const>::type` | `int const`
`integral_promotion<short&>::type` | `short&`
`integral_promotion<enum std::float_round_style>::type` | `int`