Hey guys,
I know the title isn't possible, but I'd like to here how you'd do it then.
Suppose we have this code:
Class Foo {public: int x; };
//somewhere in the code..
int main()
Foo one, two;
one.x = 10;
two.x = 20;
Foo *a = &one;
Foo *b = &two;
//We want to compare Foo::x here, not the pointers.
bool result = a > b;
return 0;
}
How would you implement this? I've thought about a compare class, as the STL containers do, and ofcourse a compare functions, but I'd like to hear if there are other options, and if you pick compare classes over compare functions and why etc.