Chapter 3. Element Reference Categories

 

In any revolutionary area, most of our current thinking is wrong.

 
 --David Suzuki
 

If we had some ham, we could have some ham and eggs, if we had some eggs.

 
 --L. Hunter Lovin

Introduction

Q1:

When is an element reference not a reference?

A1:

When it’s elicited from a collection or an iterator that does not own its element(s).

That seems like a relatively uncontentious statement. As we will see, however, it has important and far-reaching implications for STL extensions. In this chapter, I will introduce the concept of an element reference category, which is a peer to the familiar concept of iterator category and just as important to STL extensions.

The reason you may not have heard of element reference categorization ...

Get Extended STL, Volume 1: Collections and Iterators 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.