Add a reset method to the counting predicates in the test suite
authorMarshall Clow <mclow.lists@gmail.com>
Wed, 9 Jul 2014 21:04:22 +0000 (21:04 +0000)
committerMarshall Clow <mclow.lists@gmail.com>
Wed, 9 Jul 2014 21:04:22 +0000 (21:04 +0000)
llvm-svn: 212651

libcxx/test/support/counting_predicates.hpp

index eef7daf..4e0f8fb 100644 (file)
@@ -22,6 +22,7 @@ public:
        
        bool operator () (const argument_type &a) const { ++count_; return p_(a); }
        size_t count() const { return count_; }
+       void reset() { count_ = 0; }
        
 private:
        Predicate p_;
@@ -38,7 +39,8 @@ public:
        
        bool operator () (const Arg1 &a1, const Arg2 &a2) const { ++count_; return p_(a1, a2); }
        size_t count() const { return count_; }
-       
+       void reset() { count_ = 0; }
+
 private:
        Predicate p_;
        mutable size_t count_;