Passing any function as template parameter
I want to pass a function value as a template parameter to a function. Currently the best I managed to do is : template< typename F, F f > void pass() { ... } ...which is used: pass< decltype(&func), &func >(); What I would really like is to have: pass< &func >(); Is there any way to achieve this without macros? Basically to pass both the type and the value at the same time? The compiler obviously has all the information needed for that... The solution must work with variable parameters and return types. The function value is used at compile time, so it cannot be passed as an argument. C++11