C++ finalizer template
You can avoid specifying argument types twice by employing a constructor template:

template&lt;typename F&gt;
class finally
{
public:
  template&lt;typename... Args&gt;
  finally&lt;F&gt;(F action, const Args&amp;... args) { /* business as usual */ }
  ...
};


But that's not everything. The std::bind's arguments are either copied or moved, they are never passed by reference. Thus, despite const Args&amp;... args, you might end up copying your arguments.

To void this issue, consider using perfect forwarding (as well as ditching std::bind):

template&lt;typename... Args&gt;
finally&lt;F&gt;(F action, Args&amp;&amp;... args) :
    _action([action, &amp;args...]{ action(std::forward&lt;Args&gt;(args)...); }) {}


Another thing worth considering is the exception safety of action. Since you're invoking it in a destructor, you're risking facing std::terminate if it throws. A small try block will fix it. Also, as of now, enabled seems redundant.

And yes, even with all these fixes, the semantics of finally seems rather unpleasant compared to more traditional scope guards. At least to me.

Edit: full code - https://ideone.com/iThn0i