Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
jmq
· 14y ago · 0 comments
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);
Comments
[–]
evincarofautumn
14y ago
Cool, thanks for the tip. I meant to offer an example for the general case.