Buscar en Mind w/o Soul

lunes, octubre 22, 2007

Programando con Ranges (en vez de iterators)

Módulo de la librería C++ Boost, para hacer programación abstracta usando rangos en vez de colecciones.

Range Concepts
A Range is a concept similar to the STL Container concept. A Range provides iterators for accessing a half-open range [first,one_past_last) of elements and provides information about the number of elements in the Range. However, a Range has fewer requirements than a Container.

The motivation for the Range concept is that there are many useful Container-like types that do not meet the full requirements of Container, and many algorithms that can be written with this reduced set of requirements. In particular, a Range does not necessarily

* own the elements that can be accessed through it,
* have copy semantics,

No hay comentarios: