Zero-length C-array binds to pointer type

前端 未结 6 1208
误落风尘
误落风尘 2020-12-17 20:10

I recently wrote a function template which takes a reference to a C-array:

template 
void foo(T(&c_array)[N]);

6条回答
  •  遥遥无期
    2020-12-17 21:04

    Apparently ISO C forbids 0-length arrays, which is probably affecting how GCC tries to compile stuff. See this question for further details! zero length arrays vs. pointers

提交回复
热议问题