Why is “reference to array” defined in such confusing way in C++?
问题 The following code is based on a snippet from here. I want a templated function that accepts a reference to an array of size that is deduced when the function is instantiated: template<int size> void myFunction( SomeType(¶m)[size] ) { //use param and size here } //called like this: SomeType array[SomeConstant]; myFunction( array ); //SomeConstant magically gets into the function as "size" Now I'm confused with SomeType(¶m)[size] . I'd expect the following to work: template<int size>