What will happen when you attempt to compile and run the following code?
#include
using namespace std;
template
class A {
T_v;
public:
A(T v): _v(v){}
T getV() { return _v; }
};
int main()
{
A a(1);
cout << a.getV() < return 0; }
return 0;
}
program will display:1
program will not compile
program will compile
program will cause runtime exception
Submit