Iterable Concept

The Iterable concept is a way of providing a minimalist functional interface to a collection. In the way that the STL collections start from the
Container concept, the Iterable concept
provides a foundation for the OOTL collections.

A model of the Iterable concept applies a Procedure to values it contains in a sequential manner.
A simple example of an Iterable model in action is below:

The Iterable concept is more flexible than a Container since it can easily model
purely functional notions such as infinite series, or input streams, but it lacks the computational
power which comes with positional information. This is similar to the trade off inherent in the
usage of Input Iterators versus Random Access Iterators.

A model of the Iterable concept is expected to have shallow assignment semantics. Whether or not
an iterable is single pass, is not specified at this time.

RSS Feed

About the Blogger

Christopher Diggins is a software developer and freelance writer. Christopher loves programming, but is eternally frustrated by the shortcomings of modern programming languages. As would any reasonable person in his shoes, he decided to quit his day job to write his own ( www.heron-language.com ). Christopher is the co-author of the C++ Cookbook from O'Reilly. Christopher can be reached through his home page at www.cdiggins.com.