Chapter 5. Sequences and IteratorsIf 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 with algorithms, look at a number of specific implementations offered by the library, and learn how to implement new examples of each one. |