1

Very similar to this post

How can I declare template array as a parameter in templated function?

Something like this code:

template <unsigned i> void my_func (char (&a)[i]); //yes, I do need that reference

1 Answer 1

5

Just declare an extra template parameter, which contains the type in question.

template <typename T, unsigned i>
void my_func (T (&a)[i]);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.