Adding the relevant parts of the std::vector API

In this recipe, we will complete the custom container that we have been building in the first three recipes of this chapter by adding the remaining APIs that the std::vector already provides. Along the way, we will remove the APIs that do not make sense, or that we cannot support because our custom container must keep the elements in the std::vector in sorted order.

This recipe is important as it will show you how to properly create a wrapper container that can be used to encapsulate an existing container with logic that is needed from the container (for example, thread-safety, or in our case, element order).

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset