Hmm, what's up with all this recent interest in functors and C++? (see http://channel9.msdn.com/Forums/TechOff/C0x-vs2010-question-please-tell-me-what-im-doing-wrong) Smiley

 

What you need is:

guard<void(int)> g(func);

Note the missing (*), function objects are not pointer to functions.