How to overload greater than operator

  • Thread starter Thread starter John Mark Howell
  • Start date Start date
J

John Mark Howell

BlankDoes anyone know how to overload the greater than (>) operator? I know that it is probably not in accordance to the framework design patterns, but it would make my code much cleaner.
 
BlankPut this in the class of the type for which you are implementing the
greater than operator.

public static bool operator >(Type1 arg1, Type2 arg2)
{
return blah blah;
}

--
John Wood
EMail: first name, dot, last name, at priorganize.com
Does anyone know how to overload the greater than (>) operator? I know that
it is probably not in accordance to the framework design patterns, but it
would make my code much cleaner.
 
With one clarification.
public static bool operator >(Type1 arg1, Type2 arg2)
{
return blah blah;
}

has to be member of Type1 or Type2
 
Back
Top