fork download
  1. #include <stdio.h>
  2.  
  3. int arr[265];
  4.  
  5. #define CONSTEXPR /*constexpr*/ /*since gcc 2.7.2*/
  6.  
  7. template<class T, size_t N>
  8. CONSTEXPR size_t LengthOfArray(T(&)[N])
  9. {
  10. return N;
  11. }
  12.  
  13. template<class T>
  14. size_t f(T arr)
  15. {
  16. return LengthOfArray(arr);
  17. }
  18.  
  19. int main(void) {
  20. arr[5]=5;
  21. printf("%zu", f(arr));
  22. return 0;
  23. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘size_t f(T) [with T = int*]’:
prog.cpp:21:   instantiated from here
prog.cpp:16: error: no matching function for call to ‘LengthOfArray(int*&)’
stdout
Standard output is empty