Template Function common::getValueOrDefault

Function Documentation

template<typename KeyType, typename ValueType, template<typename> class Hash, template<typename> class Comparator, template<typename> class Allocator>
inline const ValueType &common::getValueOrDefault(std::unordered_map<KeyType, ValueType, Hash<KeyType>, Comparator<KeyType>, Allocator<std::pair<const KeyType, ValueType>>> &map, const KeyType &key, const ValueType &default_value)

Returns the value at key or the specified default value if the key doesn’t exist in the map.