raze-gles/tools/re2c/src/util/counter.h
Christoph Oelckers 8c95516224 - added compile tools from GZDoom repo:
- updaterevision for automated revision string generation
- re2c as a prerequisite to use sc_man in the future
- zipdir to automatically generate an engine resource file.
2019-09-22 08:52:30 +02:00

29 lines
327 B
C++

#ifndef _RE2C_UTIL_COUNTER_
#define _RE2C_UTIL_COUNTER_
namespace re2c {
template <typename num_t>
class counter_t
{
num_t num;
public:
counter_t ()
: num ()
{}
num_t next ()
{
num_t n = num;
num.inc ();
return n;
}
void reset ()
{
num = num_t ();
}
};
} // namespace re2c
#endif // _RE2C_UTIL_COUNTER_