fork download
  1. #include <cstddef>
  2.  
  3. template<std::size_t N>
  4. void arrfun_a(int (&a)[N])
  5. {
  6. for(size_t i = 0; i < N; ++i)
  7. a[i]++;
  8. }
  9.  
  10. int main()
  11. {
  12. int a[] = { 1, 2, 3, 4, 5 };
  13. arrfun_a<8>(a);
  14.  
  15. return 0;
  16. }
Compilation error #stdin compilation error #stdout 0.01s 2720KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:13: error: no matching function for call to ‘arrfun_a(int [5])’
stdout
Standard output is empty