Add comparator useful for natural comparisons on collections with

pointers to objects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13909 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Alkis Evlogimenos 2004-05-30 07:45:09 +00:00
parent f561b08d67
commit 1da7e8e0b3
2 changed files with 12 additions and 0 deletions

View File

@ -53,6 +53,12 @@ struct bitwise_or : public std::binary_function<Ty, Ty, bool> {
}
};
template<class Ty>
struct less_ptr : public std::binary_function<Ty, Ty, bool> {
bool operator()(const Ty* left, const Ty* right) const {
return *left < *right;
}
};
// deleter - Very very very simple method that is used to invoke operator
// delete on something. It is used like this:

View File

@ -53,6 +53,12 @@ struct bitwise_or : public std::binary_function<Ty, Ty, bool> {
}
};
template<class Ty>
struct less_ptr : public std::binary_function<Ty, Ty, bool> {
bool operator()(const Ty* left, const Ty* right) const {
return *left < *right;
}
};
// deleter - Very very very simple method that is used to invoke operator
// delete on something. It is used like this: