KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Is there a way to provide a default type for a parameter T of a generic, something like: class Something<T = string> { } I know there aren't many strong reasons for this, but I would like to hint the code client which type he should be preferably using. Another thing, can I restrict the generic type to a ValueType ? I've just seen that you can't, but still, I'd like to know why. Anyone has a clue? Thanks!
Tags (comma-separated)
Save Edits
Cancel