/// <summary>
 /// Returns <c>true</c> if two <typeparamref name="T"/> objects have the same value.
 /// </summary>
 /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <returns><c>true</c> if two <typeparamref name="T"/> objects have the same value; otherwise, <c>false</c>.</returns>
 public static bool operator ==(ComparableBaseWithOperators <T> left, ComparableBaseWithOperators <T> right)
 {
     return(ComparableImplementations.ImplementOpEquality(DefaultComparer, (T)left, (T)right));
 }
Пример #2
0
 /// <summary>
 /// Returns <c>true</c> if two <typeparamref name="T"/> objects have the same value.
 /// </summary>
 /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <returns><c>true</c> if two <typeparamref name="T"/> objects have the same value; otherwise, <c>false</c>.</returns>
 public static bool operator ==(ComparableBaseWithOperators <T>?left, ComparableBaseWithOperators <T>?right) =>
 ComparableImplementations.ImplementOpEquality(DefaultComparer, (T)left !, (T)right !);
Пример #3
0
 /// <summary>
 /// Returns <c>true</c> if two <typeparamref name="T"/> objects have the same value.
 /// </summary>
 /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <returns><c>true</c> if two <typeparamref name="T"/> objects have the same value; otherwise, <c>false</c>.</returns>
 public static bool operator ==(EquatableBaseWithOperators <T> left, EquatableBaseWithOperators <T> right) =>
 ComparableImplementations.ImplementOpEquality(DefaultComparer, (T)left, (T)right);
Пример #4
0
 /// <summary>
 /// Returns <c>true</c> if two <typeparamref name="T"/> objects have the same value.
 /// </summary>
 /// <param name="left">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <param name="right">A value of type <typeparamref name="T"/> or <c>null</c>.</param>
 /// <returns><c>true</c> if two <typeparamref name="T"/> objects have the same value; otherwise, <c>false</c>.</returns>
 public static bool operator ==(EquatableBaseWithOperators <T> left, EquatableBaseWithOperators <T> right)
 {
     Contract.Assume(DefaultComparer != null);
     return(ComparableImplementations.ImplementOpEquality(DefaultComparer, (T)left, (T)right));
 }