Changeset 4040425 for src/libcfa/iterator
- Timestamp:
- Mar 2, 2016, 6:15:02 PM (9 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- 36ebd03, b63e376
- Parents:
- 8f610e85
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/iterator
r8f610e85 r4040425 10 10 // Created On : Wed May 27 17:56:53 2015 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : Wed Jan 27 23:49:13201613 // Update Count : 712 // Last Modified On : Wed Mar 2 18:06:05 2016 13 // Update Count : 9 14 14 // 15 15 … … 18 18 19 19 // An iterator can be used to traverse a data structure. 20 context iterator( type iterator_type,type elt_type ) {20 trait iterator( otype iterator_type, otype elt_type ) { 21 21 // point to the next element 22 22 // iterator_type ?++( iterator_type * ); … … 32 32 }; 33 33 34 context iterator_for( type iterator_type, type collection_type,type elt_type | iterator( iterator_type, elt_type ) ) {34 trait iterator_for( otype iterator_type, otype collection_type, otype elt_type | iterator( iterator_type, elt_type ) ) { 35 35 // [ iterator_type begin, iterator_type end ] get_iterators( collection_type ); 36 36 iterator_type begin( collection_type ); … … 38 38 }; 39 39 40 forall( type iterator_type,type elt_type | iterator( iterator_type, elt_type ) )40 forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) ) 41 41 void for_each( iterator_type begin, iterator_type end, void (*func)( elt_type ) ); 42 42 43 forall( type iterator_type,type elt_type | iterator( iterator_type, elt_type ) )43 forall( otype iterator_type, otype elt_type | iterator( iterator_type, elt_type ) ) 44 44 void for_each_reverse( iterator_type begin, iterator_type end, void (*func)( elt_type ) ); 45 45
Note: See TracChangeset
for help on using the changeset viewer.