which one of the two codes is right and why ?
C C::operator++() { x++; y++; return *this; } C & C::operator++() { x++; y++; return *this; } Thanks
which one of the two codes is right and why ?
C C::operator++() { x++; y++; return *this; } C & C::operator++() { x++; y++; return *this; } Thanks
The second one is the idiomatic one: a parameter-less operator++ is the pre-fix increment operator, which should return a reference to self.
operator(int)++ or operator()++? I know one of them takes a parameter: forums.codeguru.com/…