Is there a way to use make_unique and pass the output of a function as a parameter?
auto loadedSurface1 = std::unique_ptr<SDL_Surface,SurfaceDeleter>(IMG_Load(path.c_str()));
auto loadedSurface2 = std::make_unique<SDL_Surface, SurfaceDeleter>();
loadedSurface2.reset(IMG_Load(path.c_str()));
auto loadedSurface3 = std::make_unique<SDL_Surface, SurfaceDeleter>(IMG_Load(path.c_str())));
SurfaceDeleter is a functor.
loadedSurface1 and loadedSurface2 both work fine. loadedSurface3 fails ( no instance of overloaded function matches the argument list)
If there's no way to make loadedSurface3 work, is loadedSurface2 recommended over loadedSurface1 because it uses make_unique?