O'Reilly logo

Extended STL, Volume 1: Collections and Iterators by Matthew Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required