consolidate all repos to one for archive
This commit is contained in:
21
semester_2/programiranje_2/naloga0902/ReferenceCounter.h
Normal file
21
semester_2/programiranje_2/naloga0902/ReferenceCounter.h
Normal file
@@ -0,0 +1,21 @@
|
||||
#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
|
||||
Reference in New Issue
Block a user