Presumably the idea is that you want to output the value of I::value via 3 different instances of I, where I::value is a static member, and you need to modify the value of I::value so that the first time you output, it's 1, the second time it's 2, and the third time it's 1 again.
Is that right?
Do you understand what a static member is, and how it differs from a normal member?
I think the goal here is not to overload the int cast operator as JLBorges suggested... but instead is to count the number of objects currently in existence. You would do this by incrementing 'value' in each object's constructor, and decrementing it in each object's destructor.
Ah, right, yes - well-spotted, Disch! I wasn't paying attention to those additional scope-defining braces. Largely, because the indentation isn't consistent.