I want to use the alias based on the value in template parameter. Something like this:
If W > 32:
template<size_t W>
using int_t = My_Int<W, int64_t>;
Else:
template<size_t W>
using int_t = My_Int<W, int32_t>;
I also tried std::conditional, but didn't find a good way to do it.. How should I do that? Thanks!
Using
std::conditionalyou would havewhere
My_Int<W, int64_t>is used whenW > 32is true andMy_Int<W, int32_t>is used when it is false.