cont.h:8: warning: friend declaration `bool operator==(const Container<T>&, const Container<T>&)' declares a non-template function
cont.h:8: warning: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) -Wno-non-template-friend disables this warning
//~ //---test for equal elements values in the two containers rhs and lhs
template <class T>
booloperator==(const Conatiner<T> &rhs,const Container<T> &lhs){
if (rhs.sizeC == lhs.sizeC) {
returntrue;
}
returnfalse;
}
You have the friend statement inside of your class, and the operator is a global function...am I correct?
If this is the case, the friend declaration must also be a template but because you're inside of a template class you can't reuse the T parameter or you will shadow the original parameter: