C++_generic_programming - Generic Programming Techniques in...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSE 332: C++ functions Generic Programming Techniques in C++ Generic programming allows diverse types to be used together Without requiring inheritance relations among them Lets native, library, and user-defined types work with each other well Generic abstractions rely on interface polymorphism Based on C++ templates, typedefs, and compiler’s type inference rules Allow many combinations to be composed successfully Impose specific rules on types’ interfaces Today we’ll look at some examples for why this is useful To motivate investment of effort towards a deeper understanding To show some early techniques that you can apply right away Subsequent lectures and studios will dig into this in more detail We’ll look first at key generic abstractions the STL provides Containers that can hold diverse types Iterators that define ranges, act like built-in pointer types Algorithms that use iterators to manipulate data in containers Function objects that are used to extend containers and algorithms
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 5

C++_generic_programming - Generic Programming Techniques in...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online