What is the C ++ C # Collection <T> equivalent and how do you use it?
I need to store a list / set / array of dynamically created objects of a specific base type in C ++ (and I'm new to C ++). In C #, I would use a common collection, what do I use in C ++?
I know I can use an array:
SomeBase* _anArrayOfBase = new SomeBase[max];
But I don’t get anything “free” with this - in other words, I cannot iterate over it, it does not expand automatically and so on.
So what are the other options?
thanks
+3
7 answers
std::vector, , . , , , . ( , )
std:: list - , , , , , , .
deque , .
std:: deque, , , deque , , , deque . , , .
+17