【发布时间】:2012-02-24 13:45:51
【问题描述】:
编辑:已解决,很抱歉,这是由于打字错误。
这段代码。
List<Tuple<Int16, Int16>> a = new List<Tuple<Int16, Int16>>();
Tuple<UInt16, UInt16> b = Tuple.Create<UInt16, UInt16>(4, 2);
a.Add(b);
为a.Add(b) 产生以下错误
The best overloaded method match for
'System.Collections.Generic.List<System.Tuple<short,short>>
.Add(System.Tuple<short,short>)'
has some invalid arguments.
总之
List<Tuple<short,short>>.Add(Tuple<short,short>)
has invalid arguments
我看不出这是怎么回事。
【问题讨论】:
-
@dtb:这就是答案。要么你回答问题,要么我们关闭它,因为这必须是重复的:-)
标签: c# list collections tuples abstraction