The secondary comparison of addresses and reverting to a
std::set will do the trick thanks.
I certainly don't want to invoke undefined behaviour. SurelyAs Jerry pointed out, it's not undefined, just unspecified. To
it's fine as I'm comparing pointers to the same base?
the point where (theoretically), given two pointers a and b, a<b
might be true one time, and false the next time you try it. In
practice, of course, there are (or at least have been) a lot of
cases where !(a < b) && !(b < a), even though a and b point to
different objects (and a != b); such an ordering will NOT work
with std::set.
As Jerry also pointed out, the standard requires std::less to
work. Use it instead.
--
James Kanze (GABI Software) email:ja*********@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34