VK
Size: a a a
VK
с
VK
АК
с
я:ргументов
std::numeric_limits<C>::max() >= std::numeric_limits<A>::max() &&
std::numeric_limits<C>::max() >= std::numeric_limits<B>::max() &&
std::numeric_limits<C>::min() <= std::numeric_limits<A>::min() &&
std::numeric_limits<C>::min() <= std::numeric_limits<B>::min()
Где A, B - типы переданных а
с
AF
AF
с
АК
с
AF
K
AF
K
АК
template <std::size_t Size, bool IsSigned>
struct helper;
template <1, true> struct helper { using type = std::int8_t; };
template <1, false> struct helper { using type = std::uint8_t; };
// ...
constexpr auto size1 = sizeof(L);
constexpr auto sign1 = std::is_signed_v<L>;
constexpr auto size2 = sizeof(R);
constexpr auto sign2 = std::is_signed_v<R>;
constexpr auto size = MAGIC(...);
constexpr auto sign = MAGIC(...);
using Result = typename helper<size, sign>::type;
AF
AF
АК
SS
template <N, true> struct helper { using type = std::conditional_t<...>; } // и рекурсивно через conditional'ы определить тип
template <N, false> struct helper { using type = std::conditional_t<...>; }
template <int N>
using type = std::conditional_t<N <= 1, int8_t,
std::conditional_t<N <= 2, int16_t,
std::conditional_t<N <= 4, int32_t,
std::conditional_t<N <= 8, int64_t, std::nullptr_t>>>>; //типо такого, только через int_least, как выше предложили