特に理由(C#のバージョンが古いものしか使えない等)がなければSystem.ValueTupleを使う。 以下の方法で宣言する。ValueTupleのように簡略化した宣言方法はない。 Tuple<int, string> myTuple = new Tuple<int, string>(1, "One"); System.ValueTupleの場合: ValueTupleの型を明示的に書く必要 ...
Tuples can be used to store a finite sequence of homogeneous or heterogeneous data of fixed sizes and can be used to return multiple values from a method Tuples are nothing new – they have been around ...