KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I don't think that this could be done in C#, but posting this just to make sure. Here's my problem. I would like to do something like this in C#: var x = 10; var l = new List<typeof(x)>(); or var x = 10; var t = typeof(x); var l = new List<t>(); But of course this doesn't work. Although this shouldn't be a problem as the type t is resolved at compile time. I understand that this can be solved with reflection, but as types are known at compile time using reflection would be overkill.
Tags (comma-separated)
Save Edits
Cancel