#include <type_traits>
#include <iostream>
template<size_t i>
struct best_type {
typedef typename std::conditional<
(i <= 8),
uint8_t,
typename std::conditional<
(i <= 16),
uint16_t,
typename std::conditional<
(i <= 32),
uint32_t,
uint64_t
>::type
>::type
>::type type;
};
int main() {
std::cout << sizeof(best_type<2>::type) << std::endl;
std::cout << sizeof(best_type<8>::type) << std::endl;
std::cout << sizeof(best_type<15>::type) << std::endl;
std::cout << sizeof(best_type<17>::type) << std::endl;
}
I2luY2x1ZGUgPHR5cGVfdHJhaXRzPgojaW5jbHVkZSA8aW9zdHJlYW0+CgoKdGVtcGxhdGU8c2l6ZV90IGk+CnN0cnVjdCBiZXN0X3R5cGUgewogICAgdHlwZWRlZiB0eXBlbmFtZSBzdGQ6OmNvbmRpdGlvbmFsPAogICAgICAgIChpIDw9IDgpLAogICAgICAgIHVpbnQ4X3QsCiAgICAgICAgdHlwZW5hbWUgc3RkOjpjb25kaXRpb25hbDwKICAgICAgICAgICAgKGkgPD0gMTYpLAogICAgICAgICAgICB1aW50MTZfdCwKICAgICAgICAgICAgdHlwZW5hbWUgc3RkOjpjb25kaXRpb25hbDwKICAgICAgICAgICAgICAgIChpIDw9IDMyKSwKICAgICAgICAgICAgICAgIHVpbnQzMl90LAogICAgICAgICAgICAgICAgdWludDY0X3QKICAgICAgICAgICAgPjo6dHlwZQogICAgICAgID46OnR5cGUKICAgID46OnR5cGUgdHlwZTsKfTsKICAgIAoKaW50IG1haW4oKSB7CiAgICBzdGQ6OmNvdXQgPDwgc2l6ZW9mKGJlc3RfdHlwZTwyPjo6dHlwZSkgPDwgc3RkOjplbmRsOwogICAgc3RkOjpjb3V0IDw8IHNpemVvZihiZXN0X3R5cGU8OD46OnR5cGUpIDw8IHN0ZDo6ZW5kbDsKICAgIHN0ZDo6Y291dCA8PCBzaXplb2YoYmVzdF90eXBlPDE1Pjo6dHlwZSkgPDwgc3RkOjplbmRsOwogICAgc3RkOjpjb3V0IDw8IHNpemVvZihiZXN0X3R5cGU8MTc+Ojp0eXBlKSA8PCBzdGQ6OmVuZGw7Cn0=