天真的解决方案:
#include <type_traits>
#include <cstdint>
template<typename A, typename B>
struct can_hold : std::false_type{};
template<>
struct can_hold<int8_t,int8_t> : std::true_type{};
template<>
struct can_hold<int16_t,int8_t> : std::true_type{};
template<>
struct can_hold<int16_t,int16_t> : std::true_type{};
template<>
struct can_hold<int16_t,uint8_t> : std::true_type{};
template<>
struct can_hold<int32_t,int8_t> : std::true_type{};
template<>
struct can_hold<int32_t,int16_t> : std::true_type{};
template<>
struct can_hold<int32_t,int32_t> : std::true_type{};
template<>
struct can_hold<int32_t,uint8_t> : std::true_type{};
template<>
struct can_hold<int32_t,uint16_t> : std::true_type{};
template<>
struct can_hold<int64_t,int8_t> : std::true_type{};
template<>
struct can_hold<int64_t,int16_t> : std::true_type{};
template<>
struct can_hold<int64_t,int32_t> : std::true_type{};
template<>
struct can_hold<int64_t,int64_t> : std::true_type{};
template<>
struct can_hold<int64_t,uint8_t> : std::true_type{};
template<>
struct can_hold<int64_t,uint16_t> : std::true_type{};
template<>
struct can_hold<int64_t,uint32_t> : std::true_type{};
template<>
struct can_hold<uint8_t,uint8_t> : std::true_type{};
template<>
struct can_hold<uint16_t,uint8_t> : std::true_type{};
template<>
struct can_hold<uint16_t,uint16_t> : std::true_type{};
template<>
struct can_hold<uint32_t,uint8_t> : std::true_type{};
template<>
struct can_hold<uint32_t,uint16_t> : std::true_type{};
template<>
struct can_hold<uint32_t,uint32_t> : std::true_type{};
template<>
struct can_hold<uint64_t,uint8_t> : std::true_type{};
template<>
struct can_hold<uint64_t,uint16_t> : std::true_type{};
template<>
struct can_hold<uint64_t,uint32_t> : std::true_type{};
template<>
struct can_hold<uint64_t,uint64_t> : std::true_type{};
template<>
struct can_hold<float,float> : std::true_type{};
template<>
struct can_hold<double,float> : std::true_type{};
template<>
struct can_hold<double,double> : std::true_type{};
int main(){
}