Dr. Dobb's Journal June 1998
void
Person::addPet(Dog* dog)
{
int ndogs =
getObjects("dog").entries();
if (ndogs > 3) {
cerr << "Too many dogs."
<< endl;
return;
}
associateWith(dog,
"dog",
"person");
}