#include <cstdint>
#include <cstddef>

typedef uintmax_t FullInt;

template <size_t N>
struct UInt;

template <>
struct UInt<1> { typedef uint8_t type; };

template <>
struct UInt<2> { typedef uint16_t type; };

template <>
struct UInt<4> { typedef uint32_t type; };

typedef UInt<sizeof(FullInt)/2>::type HalfInt;

#include <typeinfo>
#include <iostream>

int main()
{
  std::cerr << sizeof(FullInt) << " " << sizeof(HalfInt) << std::endl;
}