Chapter 5. Sequences and Iterators

If the STL can be described as a framework based on runtime algorithms, function objects, and iterators, we could say that the MPL is founded on compile-time algorithms, metafunctions, sequences, and iterators.1

We used sequences and algorithms informally in Chapter 3 to implement our dimensional analysis logic. If you’re familiar with the STL, you might have guessed that under the hood we were also using iterators. The library, however, has so far allowed us to remain happily ignorant of their role, by virtue of its sequence-based algorithm interfaces.

In this chapter you will gain a general familiarity with “compile-time STL,” and then proceed to formalize sequences and iterators, study their interactions ...

Get C++ Template Metaprogramming: Concepts, Tools, and Techniques from Boost and Beyond now with the O’Reilly learning platform.

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