I would like to change my function definition based on type by using enable_if_t
. Some thing similar to this:
#include<type_traits>
template<typename T> struct A;
template<typename T>
struct A{
std::enable_if_t<std::is_arithmetic<T>::value, bool>
test()
{
return true;
}
std::enable_if_t<!std::is_arithmetic<T>::value, bool>
test()
{
return false;
}
};
Currently it cannot compile at all.