diff options
Diffstat (limited to 'base/stl_helpers.hpp')
-rw-r--r-- | base/stl_helpers.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/base/stl_helpers.hpp b/base/stl_helpers.hpp index b11f95eec7..0121e12613 100644 --- a/base/stl_helpers.hpp +++ b/base/stl_helpers.hpp @@ -2,8 +2,10 @@ #include "std/algorithm.hpp" #include "std/functional.hpp" +#include "std/utility.hpp" #include "std/vector.hpp" + namespace my { namespace impl @@ -89,11 +91,11 @@ void SortUnique(vector<T> & v) // Sorts according to |comp| and removes duplicate entries according to |pred| from |v|. // Note. If several entries are equal according to |pred| an arbitrary entry of them // is left in |v| after a call of this function. -template <typename T, typename TComp, typename TPred> -void SortUnique(vector<T> & v, TComp && comp, TPred && pred) +template <typename T, typename TLess, typename TEquals> +void SortUnique(vector<T> & v, TLess && less, TEquals && equals) { - sort(v.begin(), v.end(), comp); - v.erase(unique(v.begin(), v.end(), pred), v.end()); + sort(v.begin(), v.end(), forward<TLess>(less)); + v.erase(unique(v.begin(), v.end(), forward<TEquals>(equals)), v.end()); } template <typename T, class TFn> |