template <int Size, class Element = double>class TVector{public: bool operator==(const TVector<Size, Element>) const { // тут происходит "тупое" сравнение элементов через == }}
template <int Size, class Element = double>class TVector{public: bool operator==(const TVector<Size, double>) const { // а тут по умному, через qFuzzyCompare ;) } bool operator==(const TVector<Size, Element>) const { //... }}
C++ (Qt)template <size_t Size, class Element = double>class TVector{public: }; template <size_t Size, class T>inline bool operator==(const TVector<Size, T> & x, const TVector<Size, T> & y){...} template <size_t Size>inline bool operator==(const TVector<Size, double> & x, const TVector<Size, double> & y){...}
C++ (Qt)#include <type_traits> template <int Size, class Element = double>class TVector{public: bool operator==(const TVector<Size, Element> & sec) const { if (std::is_floating_point<Element>::value) return true; else return false; }};
C++ (Qt)#include <type_traits> template <int Size, class Element = double>class TVector{public: template <class T> bool operator==(const T & sec) const { if (this->size() != sec.size()) return false; ... }
C++ (Qt) if (std::is_floating_point<Element>::value) return true; else return false;
C++ (Qt)return std::is_floating_point<Element>::value;
C++ (Qt)template <int Size, class Element = double>class TVector{public: bool operator==(const TVector<Size, Element> & sec) const { if (std::is_floating_point<Element>::value) return true; else return false; }};