Using a simple wrapper around std::vector

In this recipe, we will learn how to create our own custom container by wrapping an existing Standard Template Library container to provide custom functionality as needed. In the later recipes, we will build upon this custom container to eventually create a complete container based on std::vector.

This recipe is important because oftentimes, code that leverages an existing container is accompanied by common logic that is duplicated each time the container is used. This recipe (and this entire chapter) will teach you how to encapsulate this duplicated logic into your own container so that it can be independently tested.

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

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