22 lines
395 B
C++
22 lines
395 B
C++
#ifndef NALOGA0902_REFERENCECOUNTER_H
|
|
#define NALOGA0902_REFERENCECOUNTER_H
|
|
|
|
class ReferenceCounter {
|
|
private:
|
|
unsigned int count = 0;
|
|
public:
|
|
unsigned int operator++() {
|
|
return ++count;
|
|
}
|
|
|
|
unsigned int operator--() {
|
|
return --count;
|
|
}
|
|
|
|
unsigned int useCount() {
|
|
return count;
|
|
}
|
|
};
|
|
|
|
#endif //NALOGA0902_REFERENCECOUNTER_H
|