#include <iostream>
using namespace std;

struct Foo
{
   template <class T>
   void bar(T);
};

template<>
void Foo::bar<int>(int i)
{
   cout << i << '\n';
}

int main()
{
   Foo f;

   f.bar(1);
   f.bar("Fail!");

   return 0;
}