I'm stuck trying to call a function which is a friend of a template class. I get a compilation error (in visual studio 2010 express: unresolved external symbol "void __cdecl f(class MyClass<int> &)" (?f@@YAXAAV?$MyClass@H@@@Z) ) - though if I comment out line 27 which actually calls the function the thing compiles and runs fine.
it works. Same is done in that example you posted a link to. I guess putting a friend in a template class and giving it a template argument is not enough for compiler to figure out that f is a template function.
Note that you could alternatively put the definition of the friend function on line 7. That way there are no problems either.