1 2 3 4 5 | template<class T, const char* p> class X { }; const char p[] = "Vivisectionist"; X<int,p> x; int main() {} |
dGVtcGxhdGU8Y2xhc3MgVCwgY29uc3QgY2hhciogcD4gY2xhc3MgWCB7IH07Cgpjb25zdCBjaGFyIHBbXSA9ICJWaXZpc2VjdGlvbmlzdCI7Clg8aW50LHA+IHg7CmludCBtYWluKCkge30=
prog.cpp:4: error: ‘p’ cannot appear in a constant-expression prog.cpp:4: error: template argument 2 is invalid prog.cpp:4: error: invalid type in declaration before ‘;’ token
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


