#include <iostream>
#include <string>
static int counter = 0;
class Foo {
//static int counter = 0;
public :
Foo operator=(const Foo& b)
{
++counter;
//Somehow call default functionality of = opreator for foo.
Foo another(b);
return another;
//counter++;
}
};
int main()
{
Foo a, b, c;
a = b;
b = c;
c = a;
std::cout << counter << "\n"; // should give 3
return 0;
}