Minsky
minsky::IncrDecrCounter Struct Reference

exception-safe increment/decrement of a counter in a block More...

#include <variable.h>

Collaboration diagram for minsky::IncrDecrCounter:
Collaboration graph

Public Member Functions

 IncrDecrCounter (int &ctr)
 
 ~IncrDecrCounter ()
 

Public Attributes

int & ctr
 

Detailed Description

exception-safe increment/decrement of a counter in a block

Definition at line 56 of file variable.h.

Constructor & Destructor Documentation

◆ IncrDecrCounter()

minsky::IncrDecrCounter::IncrDecrCounter ( int &  ctr)
inline

Definition at line 59 of file variable.h.

References ctr.

59 : ctr(ctr) {++ctr;}

◆ ~IncrDecrCounter()

minsky::IncrDecrCounter::~IncrDecrCounter ( )
inline

Definition at line 60 of file variable.h.

References ctr.

60 {--ctr;}

Member Data Documentation

◆ ctr

int& minsky::IncrDecrCounter::ctr

Definition at line 58 of file variable.h.

Referenced by IncrDecrCounter(), and ~IncrDecrCounter().


The documentation for this struct was generated from the following file: