Re:Implementing Go's defer keyword in C++
by Too on Sunday October 22, 2017 @01:27AM
(#15525298)
std::unique_ptr has a widely unknown second template argument called deleter. It is designed exactly for this purpose. You just do roughly like this(written from a phone):
[ Parent
| on HN ]
There are no comments on this comment yet.