I have the following case:
T* get_somthing(){
std::vector vec; //T is trivally-copyable
//fill vec
T* temp = new T[vec.size()];
memc
Edit: This idea doesn't work because there is no way to prevent the implicit call to the destructors of base classes (thanks, molbdnilo). That they are called is, if I think of it, a good thing.
~vector()
is not virtual (is there a requirement in the standard for being or not being virtual?) this should work as long as you explicitly use your type.
By inheriting you would retain all the benefits, in particular the memory management -- except for the final bit (which you don't want).