Override Hash and IsEqual when you want additional derived class information to be considered for hashing and equality testing. In your derived class, you must call the corresponding parent class member function. For example, your Hash member function needs to call the parent class Hash member function. The following example shows a test class Hash member function.
long TSampleObjectLengthTest::Hash() const
{
long hash = TSampleObjectBaseTest::Hash();
hash += (long)fIntegerOption;
return hash;
}
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.