37 std::atomic<unsigned int> c;
41 void increase() { ++c; }
42 unsigned int decrease() {
return --c; }
54 const unsigned int x, y;
57 matrix(
unsigned int x,
unsigned int y) :
67 y(p.y) { count->increase(); }
69 ~
matrix() {
if (count->decrease() == 0) {
delete count;
delete [] data; } }
71 unsigned int length()
const {
return x * y; }
73 T* operator[](
unsigned int a) {
return &data[a * y]; }
75 T
const* operator[](
unsigned int a)
const {
return &data[a * y]; }