#ifndef ITERATOR_H #define ITERATOR_H #include "iostream.h" context iterator( type iterator_type, type elt_type ) { iterator_type ?++( iterator_type* ); iterator_type ++?( iterator_type* ); int ?==?( iterator_type, iterator_type ); int ?!=?( iterator_type, iterator_type ); lvalue elt_type *?( iterator_type ); }; context iterator_for( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) { /// [ iterator_type begin, iterator_type end ] get_iterators( collection_type ); iterator_type get_begin( collection_type ); iterator_type get_end( collection_type ); }; forall( type iterator_type, type elt_type | iterator( iterator_type, elt_type ) ) void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) ); forall( type elt_type | writeable( elt_type ), type iterator_type | iterator( iterator_type, elt_type ), dtype os_type | ostream( os_type ) ) void write_all( iterator_type begin, iterator_type end, os_type *os ); #endif /* #ifndef ITERATOR_H */