Wrapping allocated output parameters with a scoped_ptr/array
So, I have some code which looks like this: byte* ar; foo(ar) // Allocates a new[] byte array for ar ... delete[] ar; To make this safer, I used a scoped_array: byte* arRaw; scoped_array<byte> ar; foo(arRaw); ar.reset(arRaw); ... // No delete[] The question is, Is there any existing way to do this using just the scoped_array, with...