CodePudding user response:
Have been failed to upload pictures,,,Figure part code for:
Template
The class TypeComparator {
Public:
Bool equalP (*) (T, T)=this - & gt; Equals
Template
Bool equals (T t1, t2 T) {
return false;
}
Template<>
Bool equals
Return the t1==t2;
}
};
CodePudding user response:
Classes defined in the static member variables isThe template & lt; Typename T>
The class LinkedList {
Protected:
The static TypeComparator
};
CodePudding user response:
Class member functions are defined in theBool contain (T T, bool (* equals). (T, T)=compHelper equalP);