Generic Image Library: promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral > Class Template Reference

###  | #  |

Public Types | List of all members
promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral > Class Template Reference

Meta-function to define an integral type with size than is (roughly) twice the bit size of T. More...

`#include <promote_integral.hpp>`

## Public Types
using | type

## Detailed Description

template<typename T, bool PromoteUnsignedToUnsigned = false, bool UseCheckedInteger = false, bool IsIntegral = std::is_integral<T>::value>
class boost::gil::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >

Meta-function to define an integral type with size than is (roughly) twice the bit size of T.

This meta-function tries to promote the fundamental integral type T to a another integral type with size (roughly) twice the bit size of T.

To do this, two times the bit size of T is tested against the bit sizes of: short, int, long, boost::long_long_type, boost::int128_t and the one that first matches is chosen.

For unsigned types the bit size of T is tested against the bit sizes of the types above, if T is promoted to a signed type, or the bit sizes of unsigned short, unsigned int, unsigned long, std::size_t, boost::ulong_long_type, boost::uint128_t if T is promoted to an unsigned type.

By default an unsigned type is promoted to a signed type. This behavior is controlled by the PromoteUnsignedToUnsigned boolean template parameter, whose default value is "false". To promote an unsigned type to an unsigned type set the value of this template parameter to "true".

Finally, if the passed type is either a floating-point type or a user-defined type it is returned as is.

Note
  boost::long_long_type and boost::ulong_long_type are considered only if the macro BOOST_HAS_LONG_LONG is defined

## Member Typedef Documentation

## ◆ type

template<typename T , bool PromoteUnsignedToUnsigned = false, bool UseCheckedInteger = false, bool IsIntegral = std::is_integral<T>::value>

using type

Initial value:
typename detail::promote_integral::promote_to_larger
<
T,
integral_types,
min_bit_size_type::value
>::type

The documentation for this class was generated from the following file:

- promote_integral.hpp