在C#語言規範版本4中,1.6.7.5運營商是關於List<T>
運營商的信息:==
和!=
。但我找不到List<T>
中定義的這些運算符?我錯過了什麼嗎?從1.6.7.5算List <T> operator ==在C#語言規範版本4中
樣品的編號:
List<int> a = new List<int>();
a.Add(1);
a.Add(2);
List<int> b = new List<int>();
b.Add(1);
b.Add(2);
Console.WriteLine(a == b); // Outputs "True" => here I get False as well
b.Add(3);
Console.WriteLine(a == b); // Outputs "False"
請更清楚地解釋 – darnir 2012-08-07 19:18:43
你的問題請不要說「輸出」爲「我會把它想。」 :) – 2012-08-07 19:19:07
@pst這段代碼複製,並從語言規範逐字粘貼,隨着評論。 – dasblinkenlight 2012-08-07 19:26:16