I was reading std::enable_if, and noticed the following.
template <typename Integer,
std::enable_if_t<std::is_integral<Integer>::value, int> = 0
>
T(Integer) : m_type(int_t) {}
Since std::enable_if_t is a type, and it can be evaluated to int
or void
for this case, so the above code can be evaluated to
template <typename Integer,
int = 0
>
T(Integer) : m_type(int_t) {}
or
template <typename Integer,
void = 0
>
T(Integer) : m_type(int_t) {}
I can't understand int = 0
or void = 0
, would someone help me with this? Thanks.