我有一个看起来像这样的结构:
public struct Pair<T,U> {
public readonly T Fst;
public readonly U Snd;
public Pair(T fst, U snd) {
this.Fst = fst;
this.Snd = snd;
}
public override String ToString() {
return "(" + Fst +", " + Snd + ")";
}
}
现在我需要声明一个类型的变量“约会” Pair<Pair<int,int>, String>
。
- 我该如何初始化它?
- 我如何访问约会.Fst.Snd?(它的类型应该是int)