function implementation with enable_if outside of class definition
问题 So basically, I have a very basic generic class for now, currently testing the type_traits header. I am currently trying to make a function to work with certain types i.e arithmetic ones for now. #include <type_traits> template <typename T> class Test { public: template <typename U = T> typename std::enable_if<std::is_arithmetic<U>::value>::type print(); }; The function works perfectly and for arithmetic types only. But I like to keep my classes tidy and only have them have prototypes, while