raze-gles/tools/re2c/src/util/local_increment.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

22 lines
355 B
C++

#ifndef _RE2C_UTIL_LOCAL_INCREMENT_
#define _RE2C_UTIL_LOCAL_INCREMENT_
namespace re2c
{
template <typename counter_t>
struct local_increment_t
{
counter_t & counter;
inline explicit local_increment_t (counter_t & c)
: counter (++c)
{}
inline ~local_increment_t ()
{
--counter;
}
};
} // namespace re2c
#endif // _RE2C_UTIL_LOCAL_INCREMENT_