In C++ you can create a “function type” with for example:
void main() {
int a();
}
And a has the type “int ()”, but is it possible to use it? I can’t even pass ‘a’ as a template argument (but I can pass “int ()” as one)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are not declaring a “function type”. You are declaring a function. This is the same thing that you normally do in file scope, but in this case you do it in local scope
And yes, you can pass it as a template argument. It has to be a non-type argument, of course