A view is used to access a part of the data or modify or adapt the
data.
Element access using operator[]
or operator()
and (sometimes) iterators (or pointers) are defined for views.
In other words, when an iterator should be put on a Collection
that is no STL-Container,
first select a View that also is an
STL-Container with the
desired iterator.
A Sequence is too strong a condition. Which is the reason for requiring a Container or a Sequence?
X
be a Collection,
and suppose we want to create a view on this, e.g. view.
A view is created by invoking a function, view( x, arguments )
whose result_type is determined by a meta function or a functor.
We consider two cases :
view_type<X>::type view( x, arguments ) ;where
view_type
selects the right type for performing
the view.
view(x,...)
is a shortcut for
view_type<X>::type(x,...)
.
view_functor<X>::result_type view( x, arguments ) ;where
view_functor
implements the view for the given type.
view(x,...)
is a shortcut for
view_functor<X>() (x,...)
.