In my code, I use std::vector
s a lot. I read the size of the constainers and assign corresponding values. No push_back
s are involved so std::vector
gives me more than I want. I also do not want to use native C-arrays due to safety issues. Also, std::array
requires size of the container in advance. I am looking for something that is very close to std::array
but its size could be able to change just once as we do for native C-arrays: define a pointer and then allocate memory.
Asked
Active
Viewed 67 times
0

Shibli
- 5,879
- 13
- 62
- 126
-
There was a proposal for [`std::dynarray`](http://en.cppreference.com/w/cpp/container/dynarray), but it didn't make it into C++14. – juanchopanza Jun 10 '14 at 09:38
-
@juanchopanza whatever happened to `bs_array`? – TemplateRex Jun 10 '14 at 09:44
-
You don't _have_ to call `push_back` if you don't want to, y'know.. – Lightness Races in Orbit Jun 10 '14 at 09:45