Class declaration:
class unaryOperators
{
public:
int i;
unaryOperators (int tempI = 0)
{
i = tempI;
}
unaryOperators operator++ (int);
unaryOperators operator++ ();
};
Does this global definition correspond to postfix or prefix version of the overloaded operator++? Why?
unaryOperators operator++ (unaryOperators &one)
{
return one;
}
is the non-member prefix unary increment operator.
The non-member postfix unary increment operator takes an additional
intas an policy enforcing parameter.Reference:
C++03 Standard 13.5.7 Increment and decrement [over.inc]