MPL11
All Classes Namespaces Files Typedefs Macros Groups Pages
Classes
Iterable

Data structures allowing external iteration. More...

Classes

struct  boost::mpl11::head< iter >
 Returns the first element of a non-empty iterable. More...
 
struct  boost::mpl11::tail< iter >
 Extract the elements after the head of a non-empty iterable. More...
 
struct  boost::mpl11::last< iter >
 Returns the last element of a non-empty iterable. More...
 
struct  boost::mpl11::length< iter >
 Returns the number of elements in a finite iterable. More...
 
struct  boost::mpl11::at< index, iter >
 Returns the element of an iterable at the given index. More...
 
struct  boost::mpl11::at_c< index, iter >
 Equivalent to at<size_t<index>, iter>. More...
 
struct  boost::mpl11::is_empty< iter >
 Returns whether the iterable is empty. More...
 
struct  boost::mpl11::drop< n, iter >
 Drops the first n elements from an iterable and return the rest. More...
 
struct  boost::mpl11::drop_c< n, iter >
 Equivalent to drop<size_t<n>, iter>; provided for convenience. More...
 
struct  boost::mpl11::drop_while< predicate, iter >
 Drops elements from an iterable up to, but not including, the first element for which the predicate returns false. More...
 
struct  boost::mpl11::drop_until< predicate, iter >
 Equivalent to drop_while with a negated predicate. More...
 

Detailed Description

Data structures allowing external iteration.

Iterables are not required to be finite. Some operations are only well-defined on finite Iterables; the documentation of the operation and that of the Iterable in question should be consulted.

Methods

head, tail, is_empty, last, at and length.

Minimal complete definition

head, tail and is_empty.

Provided instances

Comparable

Two iterables are equal if their elements are equal when compared side-by-side, and if both iterables run out of elements at the same time, i.e. if they have the same length.

Orderable

Less-than comparison for iterables is defined as the lexicographical comparison of their elements.

Foldable

Folding is done the obvious way.

Todo:
  • Find a way to know whether an Iterable is finite and whether it has efficient xx or yy operations.
  • Perform bounds-checking in at when we have a way of knowing whether an Iterable is finite.
  • Improve the implementation of Foldable, Comparable, Orderable, drop_while, drop and default methods.