
13 Dec
2011
13 Dec
'11
1 p.m.
Rob Desbois wrote:
On 13 December 2011 10:06, Nathan Ridge
mailto:zeratul976@hotmail.com> wrote: > Your operators are likely not being called because they are of the > incorrect signature. > > ... >
Actually, the reason the operator< is not being invoked is because the way it's defined, it compares a Node object to a NodePtr:
Doh! I thought I had a feeling there was something more there :-(
IMHO, a better approach may be to supply std::set's sort predicate rather than overloading global operator<(). There may be places where you want to compare NodePtr's with normal pointer comparison semantics. Jeff