Changes between Version 4 and Version 5 of code/howto/STL
- Timestamp:
- Oct 30, 2008, 9:14:54 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/howto/STL
v4 v5 44 44 45 45 // Iterate through all elements: 46 for (std::list<type>::iterator = myList.begin(); it != myList.end(); ++it)46 for (std::list<type>::iterator it = myList.begin(); it != myList.end(); ++it) 47 47 { 48 48 std::cout << (*it) << std::endl; … … 80 80 81 81 // Iterate through all elements: 82 for (std::set<type>::iterator = mySet.begin(); it != mySet.end(); ++it)82 for (std::set<type>::iterator it = mySet.begin(); it != mySet.end(); ++it) 83 83 { 84 84 std::cout << (*it) << std::endl; … … 113 113 114 114 // Iterate through all elements: 115 for (std::map<std::string, type>::iterator = myMap.begin(); it != myMap.end(); ++it)115 for (std::map<std::string, type>::iterator it = myMap.begin(); it != myMap.end(); ++it) 116 116 { 117 117 std::cout << it->first << ": " << it->second << std::endl;