EXPLORATION 67

image

Traits and Policies

Although you may still be growing accustomed to templates, it’s time to explore two common, related use patterns: traits and policies. Programming with traits and policies is probably a new style for you, but it is common in C++. As you will discover in this Exploration, this technique is extremely flexible and powerful. Traits and policies underlie much of the C++ standard library. This Exploration looks at some of the traits and policies in the standard library, so that you can learn how to take advantage of them. It then helps you take the first steps toward writing your own.

Case Study: Iterators

Consider ...

Get Exploring C++ 11, Second Edition 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.