An iterator adaptor wraps a "dumb" STL iterator and adds some functionality; such an object is often referred to as a smart iterator. In much the same way, a container adaptor or view wraps a STL container and attaches some further functionality.
A view is (intended to be) a light-weight, immutable decorator to some existing data.
Usually, it will provide the same interface as a
but nothing further. Especially, a view will not implement methods
erase() which would modify
the underlying container.
tries to keep the relation between adapted (or "smart") iterators and views
as close as possible.
This means that a view acts like a container which has an adapted iterator type
For instance, a
filter_view<...> will define
boost::filter_iterator_generator<...>::type as its
filter_view::iterator type; its methods
end() will return filter iterators, etc.
The first to introduce a view library was Jon Seymour back in 1995.The most complete implementation of views so far is the View Template Library by Gary Powell and Martin Weiser [PW99], [WP00].
cyclic_iteratoris based upon the work of Gennadiy Rozental.
[PW99] Gary Powell and Martin Weiser, Container adaptors, Tech. Report SC 99-41, Konrad- Zuse-Zentrum für Informationstechnik Berlin, 1999, also appeared in: C/C++ Users Journal, 18 (2000), No. 4,40-51.
[Ric02a] Roland Richter, The data/view model, Tech. Report FLLL-TR-0204, Fuzzy Logic Laboratorium Linz-Hagenberg, 2002.
[Ric02b] Roland Richter, A Catalogue of Views, Tech. Report FLLL-TR-0209, Fuzzy Logic Laboratorium Linz-Hagenberg, 2002.
[WP00] Martin Weiser and Gary Powell, The View Template Library, First Workshop on C++ Template Programming, Erfurt, Germany, October 10 2000.
Last modified 28 Oct 2002.
Copyright © Roland Richter 2002. Permission to copy, use, modify, sell and distribute this software is granted provided this copyright notice appears in all copies. This software is provided "as is" without express or implied warranty, and with no claim as to its suitability for any purpose.