2

I know this is probably a dupe, but I can't for the life of me remember what the name is or even how to look it up.

I know T would the the Type you are casting to, but what is the technical name of it.

Edit Here is a link for more information on Generics

Why do C# and VB have Generics? What benefit do they provide? Generics, FTW

Community
  • 1
  • 1
Jeremy Boyd
  • 4,857
  • 7
  • 30
  • 54
  • possible duplicate of http://stackoverflow.com/questions/99686/why-do-c-and-vb-have-generics-what-benefit-do-they-provide-generics-ftw – John Saunders May 03 '10 at 22:11
  • 2
    @John, That's not a duplicate. – Tim Jarvis May 03 '10 at 22:13
  • @Tim: yes, it is. It's "what are generics"? – John Saunders May 03 '10 at 22:41
  • @John, you need to re-read both questions. This one is what is the T called and the other is what's the benefit of generics, neither are "what is generics" – Tim Jarvis May 04 '10 at 03:51
  • Close it, I don't care (especially not about rep or anything). My question is answered. But, I do think this will benefit new programmers though. Especially with the link to the question about why you should use generics. I am going to go ahead and place the link in the question. – Jeremy Boyd May 04 '10 at 12:59

2 Answers2

11

Generic Type Parameter, I think.

Greg
  • 15,877
  • 8
  • 48
  • 97
0

I always thought it was "T" for Template.

Generics, I believe is the C# implementation of C++ templates.

  • 3
    Actually, no. Generics is the C# implementation of parameterized types. Templates is the C++ implementation of parameterized types. FYI, Managed C++ implements both. – John Saunders May 03 '10 at 22:08
  • `T` is generally 'type' or 'typename' (from C++ parlance), not 'template'. `U` and `V` are commonly used has +1's like `h` and `j` are used as +1's for `i` as 'increment'. As @John briefly mentions, generics (.Net) and templates (C++) are similar, but not the same. Generics must be verifiable at compile time, whilst templates are not verifiable until instantiation. This is an important distinction because .Net does not have headers, a generic defined in a base assembly must be compilable into IL code to be stored into the assembly for later use by dependent assemblies. – Nathan Ernst May 03 '10 at 22:55
  • For the record: templates and generics are aesthetically similar, but in practice very different. – BlueRaja - Danny Pflughoeft May 04 '10 at 02:52