If I have type type declarations
typedef void (*command)(); template <command c> void execute() { c(); } void task() { }
then
execute<task>();
will compile and behave as expected. However, if I define the template as
template <command c> void execute() { command(); }
it is still compiling. I did it by accident. Now I'm confused by what is expected from the second version.
c ++ templates
Udo Klein
source share