I\'m interested: What is C#\'s analog of std::pair in C++? I found System.Web.UI.Pair class, but I\'d prefer something template-based.
Than
On order to get the above to work (I needed a pair as the key of a dictionary). I had to add:
public override Boolean Equals(Object o)
{
Pair that = o as Pair;
if (that == null)
return false;
else
return this.First.Equals(that.First) && this.Second.Equals(that.Second);
}
and once I did that I also added
public override Int32 GetHashCode()
{
return First.GetHashCode() ^ Second.GetHashCode();
}
to suppress a compiler warning.