Hacker News new | ask | show | jobs
by aleden 534 days ago
Nobody knows about BOOST_SCOPE_DEFER?

#include <boost/scope/defer.hpp>

BOOST_SCOPE_DEFER [&] {

    close(fd);                                                                    
};

Implementation here: https://github.com/boostorg/scope/blob/develop/include/boost...

1 comments

Only for those willing to stomach the entire boost hairball, which in embedded environments might be too much to ask.
Is that why I got down voted? This thing is header-only, I'm guessing it doesn't need rtti or have a big footprint.