3 ms·
You can reduce verbosity of the code by passing destructor function directly to unique_ptr constructor: std::unique_ptr<Image, void (*)(Image *)>(image, de
by jmq 14y ago
You can reduce verbosity of the code by passing destructor function directly to unique_ptr constructor:
std::unique_ptr<Image, void (*)(Image *)>(image, deallocate_image);
- evincarofautumn 14y agoCool, thanks for the tip. I meant to offer an example for the general case.