Wrappers are typically used to change at least some functionality associated with the contained resources. They may, in the sense of RAII, be used to make sure we safely use a resource.
Safety might mean making we sure we tidy up after pointers or control interaction with dynamic memory appropriately, or it might mean we make sure the variables are appropriately bounded, ...
For example, we may be interested in supporting modular arithmetic.
So we effectively need an integer to be stored, but want to make sure the operations keep us within some finite set.
So if, for example, the modulus was 11, we would define the constructors and set operations, and modification operations, to always keep us within the set ...
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
class modInt
{
private:
int value;
...
};
If the modulus is a parameter across the board it could just be a value needed in instantiating an instance of modInt. However, we need to be wary then because how do we add (or otherwise combined) modInt objects associated with different modulus values?
It makes sense to have a class template parameterised by the modulus, rather than writing a distinct class each time we wanted a different modulus or monitoring instances carefully, but that adds an extra layer of complexity.
In many situations we want to manage a collection of data. The data itself might reasonably be stored in a vector but we provide a class with it to manage the interaction with the data.