Changeset 365:9ca84022df34 in lemon-0.x
- Timestamp:
- 04/21/04 20:56:26 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@493
- Location:
- src/work/klao
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/klao/iter_map.h
r362 r365 11 11 #include <cstring> 12 12 13 #include <invalid.h> 13 14 14 15 namespace hugo { … … 113 114 } 114 115 116 117 /// For use as an iterator... 118 KeyType& first(KeyType &k, Val n) { 119 size_t i = (n ? bounds[n-1] : 0); 120 if( i < bounds[n] ) { 121 k = data[i]; 122 } 123 else { 124 k = INVALID; 125 } 126 return k; 127 } 128 129 /// For use as an iterator... 130 KeyType& next(KeyType &k) { 131 size_t i = base[k]; 132 uint8_t n = find(i); 133 ++i; 134 if( i < bounds[n] ) { 135 k = data[i]; 136 } 137 else { 138 k = INVALID; 139 } 140 return k; 141 } 142 115 143 }; 116 144 -
src/work/klao/iter_map_test.cc
r362 r365 26 26 } 27 27 } 28 29 30 28 31 29 int main() {
Note: See TracChangeset
for help on using the changeset viewer.