© { JSL }
97
++ --
·
you can overload ++ and
--
w
a
single
operator supports prefix
and
postfix
w
prefix returns the result of the call
w
postfix returns the operand before the call
struct
Meter
{
public static
Meter
operator
++ (Meter arg)
{
arg.value++;
return
arg
;
}
...
}
Meter distance;
...
postfix = distance++;
Meter distance;
...
prefix = ++distance;