I have been working on a date struct and have all the operators overloaded apropriately, but couldn't figure out how to overload the ++ operator. While I don't think it is actually a very usefull one for what I am doing, I am suddenly curious.
[tt]
public static BigDate operator ++()
{
return(internalvalue++);
}
[/tt]
This errors on compile:
[tt]
Overloaded unary operator '++' only takes one parameter
[/tt]
Alright, so I have to add a parameter. But is the parameter supposed to be? What is its value when ++ is called?
(I'm obviously having the same problem with --, and it seems very ignored in all the samples I could find through Google)
[tt]
public static BigDate operator ++()
{
return(internalvalue++);
}
[/tt]
This errors on compile:
[tt]
Overloaded unary operator '++' only takes one parameter
[/tt]
Alright, so I have to add a parameter. But is the parameter supposed to be? What is its value when ++ is called?
(I'm obviously having the same problem with --, and it seems very ignored in all the samples I could find through Google)