Try this:
Code:
template <class A, class B>
class Tester
{
public:
A a;
B b;
void print()
{
cout<<a<<","<<b<<endl;
}
void set(A x, B y)
{
a = x;
b = y;
}
};
class UseTester {
public:
void UseIt(Tester<int,int>& t)
{
t.print();
}
};
int main()
{
Tester<int,int> t;
UseTester ut;
t.set(4,5);
ut.UseIt(t);
return 0;
}
In your code, you were making the int a specialization of the template class. Ie. template <int A, int B> class X{...};
Was this what you wanted? Maybe that was what was causing you problems...