[ create a new paste ] login | about

Link: http://codepad.org/p3VKqMvd    [ raw code | output | fork ]

C++, pasted on Sep 19:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
 
using namespace std;
 
template <size_t n> void f(int a[n])
{
  cout << n << endl;
}
 
int main()
{
  f(new (int[5]));
  return 0;
}


Output:
1
2
3
In function 'int main()':
Line 12: error: no matching function for call to 'f(int*)'
compilation terminated due to -Wfatal-errors.


Create a new paste based on this one


Comments: