Prev | Current Page 4 | Next

Jon Skeet

"C# in Depth: What you need to master C# 2 and 3"

4 C# 2 and 3: new features on a solid base 54
Features related to delegates 54 ?–  Features related to the type
system 56 ?–  Features related to value types 58
2.5 Summary 59
PART 2 C# 2: SOLVING THE ISSUES OF C# 1 ............... 61
3 Parameterized typing with generics 63
3.1 Why generics are necessary 64
3.2 Simple generics for everyday use 65
Learning by example: a generic dictionary 66 ?–  Generic
types and type parameters 67 ?–  Generic methods and
reading generic declarations 71
3.3 Beyond the basics 74
Type constraints 75 ?–  Type inference for type arguments
of generic methods 79 ?–  Implementing generics 81
CONTENTS xi
3.4 Advanced generics 85
Static fields and static constructors 86 ?–  How the JIT compiler
handles generics 88 ?–  Generic iteration 90 ?–  Reflection and
generics 92
3.5 Generic collection classes in .NET 2.0 96
List 96 ?–  Dictionary 99
Queue and Stack 100 ?–  SortedListTValue> and SortedDictionary 101
LinkedList 101
3.6 Limitations of generics in C# and other languages 102
Lack of covariance and contravariance 103 ?–  Lack
of operator constraints or a ???numeric??? constraint 106
Lack of generic properties, indexers, and other member
types 108 ?–  Comparison with C++ templates 108
Comparison with Java generics 110
3.7 Summary 111
4 Saying nothing with nullable types 112
4.


Pages:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25