我在另一堂课上上课.在内部类中,我声明了struct Impl.在这个结构中有IdxPointList,它包括泛型Pair.在下面我创建了一个字典,其中uint为键,上面的列表为值,但它不接受该List.我哪里错了.
public class PointHash
{
struct Impl
{
List<Pair<uint, Vector2D>> IdxPointList;
Dictionary<uint, IdxPointList> points;
}
Impl impl;
public PointHash()
{
impl = new Impl();
}
}
Run Code Online (Sandbox Code Playgroud)
字典的声明需要一个类型,而不是一个特定的变量:
Dictionary<uint, List<Pair<uint, Vector2D>>> points;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
66 次 |
| 最近记录: |