Template Struct unify_ints

Struct Documentation

template<std::integral L, std::integral R>
struct unify_ints

For two integer types, gets the smallest integer type that fits both types.

If any of the two types are signed, then the output type will also be signed. Otherwise it is unsigned.

The output type is available through the public type type definition.

Template Parameters:
  • L – An integer type

  • R – Another integer type

Public Types

using type = std::conditional_t<(std::signed_integral<L> || std::signed_integral<R>), std::make_signed_t<temp_type>, std::make_unsigned_t<temp_type>>