Is there any difference between following 2 syntax:
template struct A; // (1)
and
template
The choice of int was probably a bad idea, it makes a difference for pointers though:
class A
{
public:
int Counter;
};
A a;
template
struct Coin
{
static void DoStuff()
{
++a->Counter; // won't compile if using const A* !!
}
};
Coin<&a>::DoStuff();
cout << a.Counter << endl;