With any large topic there is always more to learn. The next section will take you
through the most important advanced topics in generics. If you??™re feeling a bit overwhelmed
by now, you might want to skip to the relative comfort of section 3.5, where we
explore the generic collections provided in the framework. It??™s well worth understanding
the topics in the next section eventually, but if everything so far has been new to you
it wouldn??™t hurt to skip it for the moment.
3.4 Advanced generics
You may be expecting me to claim that in the rest of this chapter we??™ll be covering
every aspect of generics that we haven??™t looked at so far. However, there are so many little
nooks and crannies involving generics, that??™s simply not possible??”or at least, I certainly
wouldn??™t want to even read about all the details, let alone write about them.
Fortunately the nice people at Microsoft and ECMA have written all the details in the
freely available language specification,6 so if you ever want to check some obscure situation
that isn??™t covered here, that should be your next port of call. Arguably if your
code ends up in a corner case complicated enough that you need to consult the specification
to work out what it should do, you should refactor it into a more obvious form
anyway; you don??™t want each maintenance engineer from now until eternity to have to
read the specification.
Pages:
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189