Consider the following small code fragment:
#include
template
int test();
int main()
{
std::cout <&l
Explicitly specializing after the explicit call to the template will fail at compilation.
#include
template
int test(T y);
int main()
{
std::cout << test(0) << "\n";
}
template
int test(T y)
{
return 0;
}
// POI for test() should be right here
template<>
int test(int y)
{
return 2;
}
Check the compilation error here
Compilation error time: 0 memory: 0 signal:0
prog.cpp:21:15: error: specialization of ‘int test(T) [with T = int]’ after instantiation
int test(int y)