© { JSL }
95
Text Box: operator Syntax
operator Syntax
Folded Corner:
·operators are always defined as
wpublic static methods (never virtual)
wcopy parameters only (not ref-out )
wone+ parameter must be of containing type
struct Meter
{
    ...
    public static
        Meter operator + (Meter lhs, Meter rhs)
    {
        return new Meter(lhs.value + rhs.value);
    }
    ...
}
don't forget
 the new
void Func(Meter lhs, Meter rhs)
{
   Stuff(lhs + rhs);
}