That's the thread that made me interested in it.

 

Sorry for not providing enough info (as STL complained about)

template <typename F>
class guard {
    F m_func;
public:
    explicit guard(F func) : m_func(func) {}
    ~guard() {
        m_func(123);
    }
};