Just a STL teaser...
This is the most simple and least sophisticated implementation of what’s known as “container classes”. Those are classes which manage (contain) other objects and let you manipulate groups of them.
What this thing does not do:
- you cannot easily insert other objects in the middle, or delete objects from it.
- you have basically one way of accessing the objects inside in a sequential fashion
- you don’t have control over the order in which you retrieve the objects.
- It is very inefficient if you would want to sort the objects.
- It is also very inefficient if you want to search for a particular object.
In the STL, there is a rich variety of well-designed container template classes such as “linked list” , “vector”, “associative containers”, and many more; you can go and look for the one which best suits your needs.