class Foo { int a; float b; std::string c; /* ... */ bool operator<(const Foo& foo) const { if (a != foo.a) return a < foo.a; if (b != foo.b) return b < foo.b; if (c != foo.c) return c < foo.c; return false; } }
Thursday, January 3, 2008
C++ operator< implementation
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment