6 hours ago, Dexter wrote

No problem, anyway my answer isn't quite right. void(int) will only work with std::function, what std::function does to achieve this is close to magic

That is good to know Tongue Out

In your case you'll have to stick to something simpler:
guard<S_FUNC> g(func);

Well now i feel stupid, for not thinking of that.
It's quite obvious now when i see the solution.

Damn tunnel vision !

Thank you for the help.