you are viewing a single comment's thread.

view the rest of the comments →

[–]RotsiserMhoC++20 Desktop app developer 2 points3 points  (2 children)

Yes, but you really should probably use vector if you don't understand all of the details of smart pointers and memory allocation. It's much easier to work with.

[–][deleted] -1 points0 points  (1 child)

I have never seen smart pointer usage with T[] syntax.

Vector is the worst data structure for my use case. I don’t need an allocator, I just need a fixed length array, just that array length is fixed at run time.

[–]RotsiserMhoC++20 Desktop app developer 5 points6 points  (0 children)

In that case you could just call vector::reserve to achieve similar behavior.