What's the purpose of the Tuple(T1)/Singleton in .net?

后端 未结 4 1756
难免孤独
难免孤独 2020-12-03 13:06

One of the Tuple Types in .net 4 is a Single-Element Tuple. I just wonder what the purpose of this struct is?

The only use I saw is when using in the 8+ Tuple as it

4条回答
  •  独厮守ぢ
    2020-12-03 13:45

    All tuple types implement ITuple, so I guess that when you want to have a return type that is an ITuple, you need the option of having a single value, as you suggest.

提交回复
热议问题