4 ms·
That struct should be just struct bla { int n; std::unique_ptr<int[]> mem; bla(int n) : n(n), mem(std::make_unique<int[]>(n)) { } }. There is no reason to use n
by plorkyeran 6y ago
That struct should be just struct bla { int n; std::unique_ptr<int[]> mem; bla(int n) : n(n), mem(std::make_unique<int[]>(n)) { } }. There is no reason to use new/delete there.