#include<iostream>using namespace std; template<typename TYPE>class Hoge {public: void Foo();}; template<typename TYPE>void Hoge<TYPE>::Foo() { cout << "Foo_normal" << endl;} template<>class Hoge<int> {public: void Foo();}; template<>void Hoge<int>::Foo() { cout << "Foo_int" << endl;} int main() { Hoge<double> a; a.Foo(); Hoge<int> b; b.Foo();}
Standard input is empty
prog.cpp:22:6: error: template-id ‘Foo<>’ for ‘void Hoge<int>::Foo()’ does not match any template declaration void Hoge<int>::Foo() { ^~~~~~~~~ prog.cpp:18:7: note: candidate is: void Hoge<int>::Foo() void Foo(); ^~~
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!