Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

17 lines (13 sloc) 0.331 kb
#ifndef MAP_UTILS_HPP_INCLUDED
#define MAP_UTILS_HPP_INCLUDED
#include <map>
template<typename K, typename V>
const V& map_get_value_default(const std::map<K,V>& m, const K& key, const V& val) {
typename std::map<K,V>::const_iterator i = m.find(key);
if(i != m.end()) {
return i->second;
} else {
return val;
}
}
#endif
Jump to Line
Something went wrong with that request. Please try again.