raze-gles/tools/re2c/src/util/local_increment.h

23 lines
355 B
C
Raw Normal View History

#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_