A
Andreas Mueller
Hi,
I want to overload operator++ in my custom iterator class, which I do
like this:
internal struct IListIterator
{
public static IListIterator operator++(IListIterator ii)
{
idx += 1;
// copy at the new position->prefix operator
return new IListIterator(null, idx );
}
}
The question is: Is this the prefix or postfix form? How do both forms
differ in the declaration? I tried the C++ way with an second int as a
parameter, but that of course fails as ++ is an unary operator.
Thanks in advance,
Andy
I want to overload operator++ in my custom iterator class, which I do
like this:
internal struct IListIterator
{
public static IListIterator operator++(IListIterator ii)
{
idx += 1;
// copy at the new position->prefix operator
return new IListIterator(null, idx );
}
}
The question is: Is this the prefix or postfix form? How do both forms
differ in the declaration? I tried the C++ way with an second int as a
parameter, but that of course fails as ++ is an unary operator.
Thanks in advance,
Andy