
Originally Posted by
wysota
This should work:
bool operator==(const TestItem *one, const TestItem *two) const {
return one->value() == two->value();
}
bool operator==(const TestItem *one, const TestItem *two) const {
return one->value() == two->value();
}
To copy to clipboard, switch view to plain text mode
But this is risky, because you might have trouble checking for null values.
This one is probably safer, though a little slower...
bool operator==(const TestItem *one, const TestItem *two) const {
return (one && two) ? (one->value() == two->value()) : false;
}
bool operator==(const TestItem *one, const TestItem *two) const {
return (one && two) ? (one->value() == two->value()) : false;
}
To copy to clipboard, switch view to plain text mode
Bookmarks