I have in my program a class with a member function that should treat certain objects slightly differently than others. In order to do this, it needs to know which object was passed to it, because these objects would have peculiar data pointed to by their data members.
But it seems that referencing the name of the invoking object is impractical and ill advised. I have also considered creating a new function for these exceptional objects, but then how would the next function down on the stack know to call it?
I suppose I could create another data member as a sort of identifier and test for that when running my function; but that seems like a fairly hacky solution. What is the simplest way to do this?