Chapter 12. Using Generics with C++

At this stage, it should be clear that generics and templates are different beasts. And, even though the syntax of C++ templates shares similarities with generics, significant syntactic differences exist between the two. The goal of this chapter, then, is to provide an overview of the syntax that's associated with creating and consuming generic types in C++. This chapter briefly touches on all the fundamental generic elements, including C++ generic examples of classes, methods, interfaces, and delegates. The chapter also explains how generics and templates can be combined to strike a balance between the power of templates and the interoperability of generics.

Get Professional .NET 2.0 Generics 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.