I want to use std::unique_ptr in combination with FreeImage\'s FITAG. The code in plain C would be:
std::unique_ptr
... load image; FITAG* tag = NULL; FreeImag
Reverse the order of operations; first acquire the resource and then construct the unique_ptr.
unique_ptr
FITAG *p = NULL; FreeImage_GetMetadata(FIMD_EXIF_EXIF, bitmap, "Property", &p); std::unique_ptr tag(p, &FreeImage_DeleteTag);