public bool Equals(ImmutableContainer <T>?other) { if (other is null) { return(false); } return(ReferenceEquals(this, other) || EqualityComparer <T> .Default.Equals(Value, other.Value)); }
public int CompareTo(ImmutableContainer <T>?other) { if (Value is not IComparable <T> comparable) { throw new InvalidOperationException("T must be IComparable."); } return(comparable.CompareTo(other !.Value)); }