Template type deduction in function return type
问题 This is in continuation with the question posted at Template type deduction for member variables and function arguments My .h file contains the following lines. #include <iostream> #include <complex> #include <typeinfo> template <typename T> class MyClass { template <typename T0> struct myTypeTraits { using type = T0; }; template <typename T0> struct myTypeTraits<std::complex<T0>> { using type = T0; }; public: using T0 = typename myTypeTraits<T>::type; void setVar1(const T0& v); void setVar2