diff options
Diffstat (limited to 'libcxx/test/support/counting_predicates.hpp')
-rw-r--r-- | libcxx/test/support/counting_predicates.hpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libcxx/test/support/counting_predicates.hpp b/libcxx/test/support/counting_predicates.hpp index 4e0f8fb7133..e825848fc48 100644 --- a/libcxx/test/support/counting_predicates.hpp +++ b/libcxx/test/support/counting_predicates.hpp @@ -11,16 +11,13 @@ #define __COUNTING_PREDICATES_H -template <typename Predicate> -struct unary_counting_predicate { +template <typename Predicate, typename Arg> +struct unary_counting_predicate : public std::unary_function<Arg, bool> { public: unary_counting_predicate(Predicate p) : p_(p), count_(0) {} ~unary_counting_predicate() {} - typedef typename Predicate::argument_type argument_type; - typedef bool result_type; - - bool operator () (const argument_type &a) const { ++count_; return p_(a); } + bool operator () (const Arg &a) const { ++count_; return p_(a); } size_t count() const { return count_; } void reset() { count_ = 0; } |