can you help me out with a quick question? I am confused how we should build comparable operators. if we change the arguments then that is overloading, but if we keep the arguments the same then I cannot seem to compare an inherited classes member to another one of those inherited classes if it thinks it is of the base class. I am never comparing objects unless they are the exact same type, but I would still like to build pure virtual members in the base class. any hints or link to a well phrased article would be appreciated.
Disch's solution works, but I want to comment something. Your requirements are abusing the idea of polymorphism. You have some base class B and some derived classes D1 and D2. You want to have operation in B whose semantics change in D1 and D2. Basically, you are reusing the operation's signature to implement whatever you need in the derived classes. Sure, you may need to do that for technical purposes, but it is conceptually wrong.
Disch uses the fact that equality comparison can be adjusted easily by claiming that D1 == D2 fails. Specifically, D1 is not comparable to D2, so it is not true, although notice that if you follow this logic with relational comparison (<, >, etc) you will probably violate the requirements for total ordering of the elements.
I am saying this only to warn you. IMO, you should use generic container that calls the proper comparison operation, which does not have to be virtual. Instead, you may have separate comparison function with different prototype in each class. It is the container that should be responsible for recognizing the version that it must use. If you are afraid of the eminent generation of many template instances of the container and the resulting code bloat, you are right. So either use virtual comparison as Disch proposed or take a leap and create your own container with this one as starting point: http://www.cplusplus.com/forum/general/36756/#msg199204
in this case my program shouldnt be comparing things of different types, and I at least set it up so I would receive an error message if this happens. I see what you are saying though and I will keep that in mind for future projects.