I need a template class which:
- Manages an object through a pointer to keep the owning class as small as possible
- Provides move/copy/assigment operations, so that I do not need to implement them in the class.
I have thought about:
- std::unique_ptr but this cannot be copied, 2 is not satisfied
- An array of size 1, but it will generally manage the object directly as a member, so 1 is not satisfied
- A vector of size 1 could work, but it might be optimized for small size in some implementations, thus not satisfying 1 either
I know how to implement this, but is there really nothing in the standard library for doing this? I'd prefer avoiding reinventing the wheel...
Thanks!