Operations on Type Parameters
Let’s ask ourselves a quick question: Given a type parameter T
, what kind of operations can we carry out over it? Because the type parameter T
can be substituted for anything, our generic code can’t deal with specifics of a certain type. Nevertheless, a few basic operations can be meaningfully defined.
Get C# 5.0 Unleashed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.