What use is there for a Tuple with one common type parameter?

Possible duplicate:
What is the purpose of Tuple (T1) / Singleton in .net?

Is the only reason Tuple<T1> for consistency with other tuples with more typical type parameters? Maybe the conversion code should not deal with a special case of the same type?

Is it used on its own?

+4
source share
1 answer

You are absolutely right - this avoids a special case. If you are writing a code generator, for example, you do not need to use a special case for a single type parameter.

From the documentation - Tuple Class (Of T1) :

Syntax is used relatively rarely in application development.

+1
source

Source: https://habr.com/ru/post/1387342/


All Articles