I want to use std::unique_ptr in combination with FreeImage's FITAG. The code in plain C would be:
... load image;
FITAG* tag = NULL;
FreeImage_GetMetadata(FIMD_EXIF_EXIF, bitmap, "Property", &tag);
... do some stuff with tag;
FreeImage_DeleteTag(tag);
... delete image;
My attempt with unique_ptr:
std::unique_ptr<FITAG, void(*)(FITAG*)> tag(NULL, &FreeImage_DeleteTag);
FreeImage_GetMetadata(FIMD_EXIF_EXIF, bitmap, "Property", &tag.get());
which obviously returns:
cannot take the address of an rvalue of type 'pointer' (aka 'FITAG *')
How would I solve this?
Thanks a lot in advance.