Changeset dafbde8 for libcfa/src/iterator.hfa
- Timestamp:
- Jan 20, 2021, 4:49:40 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 454f478
- Parents:
- 92bfda0 (diff), fd54fef (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/iterator.hfa
r92bfda0 rdafbde8 17 17 18 18 // An iterator can be used to traverse a data structure. 19 trait iterator( otype iterator_type, otypeelt_type ) {19 trait iterator( iterator_type, elt_type ) { 20 20 // point to the next element 21 21 // iterator_type ?++( iterator_type & ); … … 31 31 }; 32 32 33 trait iterator_for( otype iterator_type, otype collection_type, otypeelt_type | iterator( iterator_type, elt_type ) ) {33 trait iterator_for( iterator_type, collection_type, elt_type | iterator( iterator_type, elt_type ) ) { 34 34 // [ iterator_type begin, iterator_type end ] get_iterators( collection_type ); 35 35 iterator_type begin( collection_type ); … … 37 37 }; 38 38 39 forall( otype iterator_type, otypeelt_type | iterator( iterator_type, elt_type ) )39 forall( iterator_type, elt_type | iterator( iterator_type, elt_type ) ) 40 40 void for_each( iterator_type begin, iterator_type end, void (* func)( elt_type ) ); 41 41 42 forall( otype iterator_type, otypeelt_type | iterator( iterator_type, elt_type ) )42 forall( iterator_type, elt_type | iterator( iterator_type, elt_type ) ) 43 43 void for_each_reverse( iterator_type begin, iterator_type end, void (* func)( elt_type ) ); 44 44
Note: See TracChangeset
for help on using the changeset viewer.