diff options
Diffstat (limited to 'Source/kwsys/testHashSTL.cxx')
-rw-r--r-- | Source/kwsys/testHashSTL.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/kwsys/testHashSTL.cxx b/Source/kwsys/testHashSTL.cxx index 4ed2f89..18cae7f 100644 --- a/Source/kwsys/testHashSTL.cxx +++ b/Source/kwsys/testHashSTL.cxx @@ -27,30 +27,30 @@ template class kwsys::hash_set<int>; static bool test_hash_map() { - typedef kwsys::hash_map<const char*, int> mtype; + using mtype = kwsys::hash_map<const char*, int>; mtype m; const char* keys[] = { "hello", "world" }; m[keys[0]] = 1; m.insert(mtype::value_type(keys[1], 2)); int sum = 0; - for (mtype::iterator mi = m.begin(); mi != m.end(); ++mi) { - std::cout << "Found entry [" << mi->first << "," << mi->second << "]" + for (auto& mi : m) { + std::cout << "Found entry [" << mi.first << "," << mi.second << "]" << std::endl; - sum += mi->second; + sum += mi.second; } return sum == 3; } static bool test_hash_set() { - typedef kwsys::hash_set<int> stype; + using stype = kwsys::hash_set<int>; stype s; s.insert(1); s.insert(2); int sum = 0; - for (stype::iterator si = s.begin(); si != s.end(); ++si) { - std::cout << "Found entry [" << *si << "]" << std::endl; - sum += *si; + for (int si : s) { + std::cout << "Found entry [" << si << "]" << std::endl; + sum += si; } return sum == 3; } |