aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils
diff options
context:
space:
mode:
authorlloyd <[email protected]>2009-11-16 17:07:38 +0000
committerlloyd <[email protected]>2009-11-16 17:07:38 +0000
commit22a47e97f459337ff8c2b9fdcf68cb1514b19b34 (patch)
tree3eacf8d877eb0f3c6bc19f0b1995bedea224591c /src/utils
parentfc5fadb281c509855a0ae20ecc70bfe9d681a1af (diff)
Use auto for long iterator names, etc.
It will be nice to convert to the range-based for loop once that's available.
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/datastor/datastor.cpp7
-rw-r--r--src/utils/stl_util.h19
2 files changed, 2 insertions, 24 deletions
diff --git a/src/utils/datastor/datastor.cpp b/src/utils/datastor/datastor.cpp
index 129dad9bf..9f8ba2c24 100644
--- a/src/utils/datastor/datastor.cpp
+++ b/src/utils/datastor/datastor.cpp
@@ -65,12 +65,9 @@ Data_Store::search_with(const Matcher& matcher) const
*/
std::vector<std::string> Data_Store::get(const std::string& looking_for) const
{
- typedef std::multimap<std::string, std::string>::const_iterator iter;
-
- std::pair<iter, iter> range = contents.equal_range(looking_for);
-
std::vector<std::string> out;
- for(iter i = range.first; i != range.second; ++i)
+ auto range = contents.equal_range(looking_for);
+ for(auto i = range.first; i != range.second; ++i)
out.push_back(i->second);
return out;
}
diff --git a/src/utils/stl_util.h b/src/utils/stl_util.h
index fc4d4effe..4cc081733 100644
--- a/src/utils/stl_util.h
+++ b/src/utils/stl_util.h
@@ -37,25 +37,6 @@ inline R search_map(const std::map<K, V>& mapping, const K& key,
}
/*
-* Function adaptor for delete operation
-*/
-template<class T>
-class del_fun : public std::unary_function<T, void>
- {
- public:
- void operator()(T* ptr) { delete ptr; }
- };
-
-/*
-* Delete the second half of a pair of objects
-*/
-template<typename Pair>
-void delete2nd(Pair& pair)
- {
- delete pair.second;
- }
-
-/*
* Insert a key/value pair into a multimap
*/
template<typename K, typename V>