Maybe this can help
http://www.gotw.ca/gotw/076.htm
Each template class is a unique type with no relationship
with the other instantiations. You are trying to declare
a friend that you know known anything about it.
In case you have a class for numeric types you can make
your class explicitly be friend of each possible
instantiations that you can think about. (int, long, double etc...)
template<typename T>
class C
{
public:
template<typename U>
void f123( C<U> &other )
{
other.i = 1;
}
private:
friend class C<float>;
friend class C<int>;
...etc...
int i;
};