Initial commit

This commit is contained in:
2025-11-22 16:25:58 +01:00
commit 44f8d48356
19 changed files with 1510 additions and 0 deletions

17
RC.h Normal file
View File

@ -0,0 +1,17 @@
#pragma once
class RC
{
public:
RC() : _rc(new int[1]) { *_rc = 1; };
RC(const RC &r) noexcept : _rc(r._rc) { *_rc += 1; }
RC(RC &&r) noexcept : _rc(r._rc) { }
~RC() { if (!--*_rc) delete[] _rc; };
int rc() { return *_rc; }
bool last() { return *_rc == 1; }
private:
int* _rc;
};