When overloading the "==" operator in c++, is there a standard definition as to what equality explicitly means, or a set of guidelines as how "==" should behave?
I currently have a class that does not store its entire self in memory. It basically uses a priority queue to determine how often an object inside itself is being used and when objects are popped from the end of the queue they are removed from memory and written to disk.
So now the problem occurs with equality, what does it mean for two of these objects to be equal. Because we could start with objects A and B which are the same in every way, they have loaded the same data into memory and they have the same data on disk. But then after calling a series of functions on A and B they could now be different. A and B still have the same data on disk but they they have different data loaded into memory. So the question is should A == B
resolve to true or false?
Are there a set of rules or guidelines that define how this should work? Or is this just a situation where I decide what makes the most sense for the program and document what "==" does?