T
thomas.grund
Hello,
the following does not compile due to problems with the + operator. The same thing works without templates. How can I achive this?
Thanks a lot,
Thomas
template <typename T = double> class CVariable {
};
template <typename T = double> class CSymbolic {
public:
CSymbolic(CVariable<T>){}
CSymbolic(){}
};
template <typename T> CSymbolic<T> operator+(CSymbolic<T> a1, CSymbolic<T> a2) {
return CSymbolic();
}
int main() {
CVariable<> x, y;
CSymbolic<> f1 = x+y; // problem here
}
the following does not compile due to problems with the + operator. The same thing works without templates. How can I achive this?
Thanks a lot,
Thomas
template <typename T = double> class CVariable {
};
template <typename T = double> class CSymbolic {
public:
CSymbolic(CVariable<T>){}
CSymbolic(){}
};
template <typename T> CSymbolic<T> operator+(CSymbolic<T> a1, CSymbolic<T> a2) {
return CSymbolic();
}
int main() {
CVariable<> x, y;
CSymbolic<> f1 = x+y; // problem here
}