boost::geometry::promote_integral
promote_integral.hpp
typename T
bool PromoteUnsignedToUnsigned PromoteUnsignedToUnsigned false
bool UseCheckedInteger UseCheckedInteger false
bool IsIntegral IsIntegral boost::is_integral<T>::type::value
detail::promote_integral::bit_size< T > typedef detail::promote_integral::bit_size<T> boost::geometry::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >::bit_size_type bit_size_type
boost::mpl::if_c< (is_unsigned &&PromoteUnsignedToUnsigned), unsigned_integral_types, signed_integral_types >::type typedef boost::mpl::if_c< (is_unsigned && PromoteUnsignedToUnsigned), unsigned_integral_types, signed_integral_types >::type boost::geometry::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >::integral_types integral_types
boost::mpl::if_c< (PromoteUnsignedToUnsigned &&is_unsigned), boost::mpl::size_t<(2 *bit_size_type::value)>, typename boost::mpl::if_c< is_unsigned, boost::mpl::size_t<(2 *bit_size_type::value+1)>, boost::mpl::size_t<(2 *bit_size_type::value-1)> >::type >::typ typedef boost::mpl::if_c< (PromoteUnsignedToUnsigned && is_unsigned), boost::mpl::size_t<(2 * bit_size_type::value)>, typename boost::mpl::if_c < is_unsigned, boost::mpl::size_t<(2 * bit_size_type::value + 1)>, boost::mpl::size_t<(2 * bit_size_type::value - 1)> >::type >::typ boost::geometry::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >::min_bit_size_type) ) min_bit_size_type
boost::mpl::list< short, int, long > typedef boost::mpl::list< short, int, long > boost::geometry::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >::signed_integral_types signed_integral_types
boost::mpl::list< unsigned short, unsigned int, unsigned long, std::size_t > typedef boost::mpl::list< unsigned short, unsigned int, unsigned long, std::size_t > boost::geometry::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >::unsigned_integral_types unsigned_integral_types
detail::promote_integral::promote_to_larger< T, typename boost::mpl::begin< integral_types >::type, typename boost::mpl::end< integral_types >::type, min_bit_size_type::value >::type typedef detail::promote_integral::promote_to_larger< T, typename boost::mpl::begin<integral_types>::type, typename boost::mpl::end<integral_types>::type, min_bit_size_type::value >::type boost::geometry::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >::type type
bool const bool const boost::geometry::promote_integral< T, PromoteUnsignedToUnsigned, UseCheckedInteger, IsIntegral >::is_unsigned is_unsigned boost::is_unsigned<T>::type::value

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

If the macro BOOST_GEOMETRY_NO_MULTIPRECISION_INTEGER is not defined, boost's multiprecision integer cpp_int<> is used as a last resort.

If BOOST_GEOMETRY_NO_MULTIPRECISION_INTEGER is defined and an appropriate type cannot be detected, the input type is returned as is.

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

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

boost::int128_type and boost::uint128_type are considered only if the macros BOOST_HAS_INT128 and BOOST_GEOMETRY_ENABLE_INT128 are defined

- boost::geometry::promote_integral
  bit_size_type
- boost::geometry::promote_integral
  integral_types
- boost::geometry::promote_integral
  is_unsigned
- boost::geometry::promote_integral
  min_bit_size_type
- boost::geometry::promote_integral
  signed_integral_types
- boost::geometry::promote_integral
  type
- boost::geometry::promote_integral
  unsigned_integral_types