Function f allocates a few bytes that are returned in the form of a unique_ptr<char*>. How "smart" is this smart pointer ?
When the returned unique_ptr goes out of scope, are those allocated bytes returned to the system ?
The managed object here is a pointer (char*), not the bytes it points to ! (hence the specialization for arrays)
Answer @Miles Budnek
No. Consider a unique_ptr<char[]>.