[deleted]
Re:Emulating Swift's “defer” in C, with Clang or GCC+Blocks
by randomfool on Saturday October 10, 2015 @12:43PM
(#10366038)
A std::vector per defer? Copying rather than moving std::funcs? Inserting into front of vector of funcs? Gratuitous allocs galore!
Just give me a wrapper with a destructor plz. (uniq_ptr can even get the job done in a pinch)
[deleted]
Re:Emulating Swift's “defer” in C, with Clang or GCC+Blocks
by randomfool on Saturday October 10, 2015 @12:58PM
(#10366099)
See rarely used second template arg of unique_ptr- the cleanup fn can be specified.