I declared a private variable
vector<SomeClass> theVector;
someplace inside my SomeClass class.
Why can’t I say: delete theVector inside my SomeClass destructor?
The compiler error says:
type `class Vector<SomeClass>' argument given to `delete', expected pointer
What expected pointer?
If new and delete go hand in hand.
To delete something you need to create it via new (which gives you a pointer). You can then delete the pointer. The way you are declaring the vector it is being created on the stack (not the heap) and will be deallocated when it goes out of scope.