that's getting harder and harder to make ICC, GCC and clang all happy: one wants type_name to be static and if it is so then the other one triggers 'unused function' warnings -> a forward declaration seems to do the trick

This commit is contained in:
Gael Guennebaud 2013-06-22 10:51:45 +02:00
parent 260a923334
commit bea4a67c92

View File

@ -377,7 +377,9 @@ template<> struct GetDifferentType<double> { typedef float type; };
template<typename T> struct GetDifferentType<std::complex<T> > template<typename T> struct GetDifferentType<std::complex<T> >
{ typedef std::complex<typename GetDifferentType<T>::type> type; }; { typedef std::complex<typename GetDifferentType<T>::type> type; };
template<typename T> static std::string type_name() { return "other"; } // Forward declaration to avoid ICC warning
template<typename T> std::string type_name();
template<typename T> std::string type_name() { return "other"; }
template<> std::string type_name<float>() { return "float"; } template<> std::string type_name<float>() { return "float"; }
template<> std::string type_name<double>() { return "double"; } template<> std::string type_name<double>() { return "double"; }
template<> std::string type_name<int>() { return "int"; } template<> std::string type_name<int>() { return "int"; }