次のような構造体があります。
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 + ")";
}
}
ここで、 type の変数「予定」を宣言する必要がありますPair<Pair<int,int>, String>
。
- どうすれば初期化できますか?
- 予定.Fst.Sndにアクセスするにはどうすればよいですか? (その型は int である必要があります)