src
counter.h
Go to the documentation of this file.
1 #ifndef _RE2C_UTIL_COUNTER_
2 #define _RE2C_UTIL_COUNTER_
3 
4 namespace re2c {
5 
6 template <typename num_t>
7 class counter_t
8 {
9  num_t num;
10 
11 public:
13  : num ()
14  {}
15  num_t next ()
16  {
17  num_t n = num;
18  num.inc ();
19  return n;
20  }
21  void reset ()
22  {
23  num = num_t ();
24  }
25 };
26 
27 } // namespace re2c
28 
29 #endif // _RE2C_UTIL_COUNTER_
num_t next()
Definition: counter.h:15
void reset()
Definition: counter.h:21
Definition: bitmap.cc:10