Consider, please, my code of the finalizer template:#include <functional>template<typename F, typename... Args>class finally{public:  finally(F action, const Args&... args) :      _action(std::bind(action, args...))  {}  ~finally()  {    if(enabled)      _action();  }  bool enabled = true;private:  std::function<void()> _action;};In particular I would enhance this template to avoid of using a typenames twice. Let's say we need to close some file on leaving some block of code. Then we declare an object:finally<int(int), int> f(close, some_file);Here I used the standard close function as an action. But I should use int twice in the <int(**int**), **int**>. Is there any way to avoid this?
C++ finalizer template
c++;c++11;template;variadic