hello, everyone! i would appreciate if any of c++ guru's will help me to resolve the issue i have faced.
i have a template class with operator overloads:
i have a class derived from it.Code:template <class Object> class ObjectSet { public: const ObjectSet<Object> operator+(const ObjectSet<Object> &) const; const ObjectSet<Object> operator-(const ObjectSet<Object> &) const; const ObjectSet<Object> operator*(const ObjectSet<Object> &) const; /// };
Code:class NodeSet: public ObjectSet<Node> { /// };
in main() i have the following:
when i try to compile it compiler error with the following error emerges on line 8:Code:1 ObjectSet<int> aos; 2 ObjectSet<int> bos; 3 ObjectSet<int> cos; 4 cos = aos+bos; 5 NodeSet ans; 6 NodeSet bns; 7 NodeSet cns; 8 cns = ans+bns;
though there is no error about line 4. could you please help me to understand, what can be the problem that does not allow me to compile the code?Code:no match for 'operator=' in 'cns = ObjectSet<Object>::operator+(const ObjectSet<Object>&) const [with Object = Node](((const ObjectSet<Node>&)((const ObjectSet<Node>*)((ObjectSet<Node>*)(&bns)))))'




Reply With Quote
