C++ (Qt)template<int Size, typename T>bool operator ==( const TVector<Size, T> &, const TVector<Size, T> & ){ cout << "operator== for T" << endl; return false;} template<int Size>bool operator ==( const TVector<Size, double> &, const TVector<Size, double> & ){ cout << "operator== for double" << endl; return false;}
C++ (Qt)template<>bool operator ==( const TVector<1, double> &, const TVector<1, double> & ) {...}
C++ (Qt)template<class T>struct compare_helper{ static bool compare(const T& x, const T& y) { return x == y; }}; template<>struct compare_helper<double>{ static bool compare(const double& x, const double & y) { return qFuzzyCompare(x, y); }}; template <size_t Size, class T>bool operator==(const TVector<Size, T> & x, const TVector<Size, T> & y){ return std::equal(x.begin(), x.end(), y.begin(), compare_helper<T>::compare);}
C++ (Qt)template <class T>void func(T) { ... } template<>void func<double>(double) { ... }