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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.