Changeset 366:be6fe0ea99b5 in lemon-0.x for src
- Timestamp:
- 04/21/04 21:10:59 (20 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@494
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/klao/iter_map_test.cc
r365 r366 27 27 } 28 28 29 struct Int { 30 int a; 31 32 Int(int b = 5) : a(b) {} 33 Int(Invalid) : a(-1) {} 34 35 operator int() const { return a; } 36 37 bool valid() { return a != -1; } 38 }; 39 40 typedef StdMap<Int,int> BaseMap2; 41 typedef IterableBoolMap<BaseMap2> TestBoolMap2; 42 43 29 44 int main() { 30 45 … … 180 195 181 196 } 197 198 { 199 cout << "\n\n\nTest a masikfele iteralasra:\n"; 200 201 BaseMap2 base(344); 202 TestBoolMap2 test(base,false); 203 204 cout << "Inserting 12 to class true...\n"; 205 test.insert(12,true); 206 print(test,2); 207 208 cout << "Inserting 22 to class true...\n"; 209 test.insert(22,true); 210 print(test,2); 211 212 cout << "Inserting 10 to class false...\n"; 213 test.insert(10,false); 214 print(test,2); 215 216 cout << "Testing some map values:\n"; 217 cout << " 12: " << test[12] << endl; 218 cout << " 22: " << test[22] << endl; 219 cout << " 10: " << test[10] << endl; 220 cout << " 42: " << test[42] << endl; 221 222 cout << "The elements of the \"true\" class: "; 223 Int a; 224 for(test.first(a, true); a.valid(); test.next(a)) { 225 cout << " " << a; 226 } 227 cout << endl; 228 } 182 229 }
Note: See TracChangeset
for help on using the changeset viewer.