I want to make a constructor for a class, using any integral type, but differentiate between signed and unsigned. I don't want this to be a template on the class itself. The following is not working. Visual Studio is just saying no arguments will match.
class Thing{
public:
template<typename Integral>
Thing(
typename std::enable_if<
std::is_integral<Integral>::value &&
!std::is_same<Integral,bool>::value &&
std::is_signed<Integral>::value
,Integral
>::type num
){
//constructor using signed variable as input
}
template<typename Integral>
Thing(
typename std::enable_if<
std::is_integral<Integral>::value &&
!std::is_same<Integral,bool>::value &&
!std::is_signed<Integral>::value//notice this is different
,Integral
>::type num
){
//constructor using unsigned variable as input
}
};