Add a reset method to the counting predicates in the test suite

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@212651 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2014-07-09 21:04:22 +00:00
parent 484728789e
commit bbeca21f26

View File

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