I have to use a library function that allocates a bit of memory for a generated string and returns a `char*`, with the expectation that the caller eventually free the memory with `free()`.

```
// Example declaration of the library function:
char* foo();
// ...
// Example usage:
auto foo_str = foo();
// ...
free(foo_str);

```

Is it possible to construct a `std::string` from this pointer, passing ownership of the memory to the string object so it will be freed when the string is destructed? I know I could implement my own wrapper that would give this RAII behavior, but I'm guessing this wheel has already been invented once.