Sorry if this has been asked before, but I was unable to find it.
So im trying to educate myself about templates and the new C++11 features (mainly lambdas, somethin
A function is implicitly convertible to a pointer to itself; this conversion happens pretty much everywhere. Test(Callback)
is exactly the same as Test(&Callback)
. There is no difference. In both cases, Func
is deduced to be void(*)(int)
.
Function pointers are weird. You can find out more about them in "Why do all these crazy function pointer definitions all work?"