# Ticket #82: counter-reset.patch

File counter-reset.patch, 1.4 KB (added by Peter Kovacs, 15 years ago)
• ## lemon/counter.h

# HG changeset patch
# User Peter Kovacs <kpeter@inf.elte.hu>
# Date 1213465928 -7200
# Node ID 8ceb318224b18d21c969ca15f98b31ced37aa0b5
# Parent  d57ae6f0a335ba6ee61d0f1e4fd7f11460318268
Remove reset() functions from SubCounter classes (ticket #82)

diff -r d57ae6f0a335 -r 8ceb318224b1 lemon/counter.h
 a int operator--(int) { return count--; } _SubCounter &operator+=(int c) { count+=c; return *this;} _SubCounter &operator-=(int c) { count-=c; return *this;} void reset(int c=0) {count=c;} operator int() {return count;} }; int operator--(int) { _parent--; return 0;} _NoSubCounter &operator+=(int c) { _parent+=c; return *this;} _NoSubCounter &operator-=(int c) { _parent-=c; return *this;} void reset(int) {} void reset() {} operator int() {return 0;} }; ///\e Counter &operator-=(int c) { count-=c; return *this;} /// Resets the counter to the given value. /// Resets the counter to the given value. /// \note This function does not reset the values of /// \ref SubCounter "SubCounter"s but it resets \ref NoSubCounter /// "NoSubCounter"s along with the main counter. void reset(int c=0) {count=c;} /// Returns the value of the counter. operator int() {return count;}