I am looking for a C ++ container that intersects between boost :: array, boost :: scoped_array and std :: vector.
I need an array dynamically allocated via new [] (without custom allocators) contained in a type that has a meaningful copy constructor.
boost :: array has a fixed size, and although I do not need to resize, I do not know the size of the array at compile time.
boost :: scoped_array does not have a copy constructor, which means that I need to manually add one to each class using std :: copy (my previous copy-paste application). This is also error prone, as you better make sure that when you add the field to which you added the correct initializer to the custom copy constructor; that is, template loads.
std :: vector uses some pre-allocation system and therefore does not use the new [] operator. This is problematic because it requires specialized dispensers, and, even worse, even this is not enough, as there are some odd corner cases (which I don’t quite understand) in which there are semantics of returning to the value causing problems; I don’t want the container to do anything unusual, but just contain a new array [] 'd and copy it in its copy constructor - and preferably overload all the usual suspects that could be used as a collection.
, . , scoped_array, - (, std:: copy), . - ?
, .