I have a project specification(so I can’t change it) where I’ve created a function
const mat4& GetView() const;
The mat4 object is created on this function:
mat4* a = new mat4();
mat4 &ret = *a;
return ret;
And later on I’ll want to delete it. But how can I do it once I’ve left the GetView method?
Thanks.
Take the address:
(I’m assuming that
operator&is not overloaded. If it is, you need to do something a bit more complex.)