+ return (pos != map.end()) ? (pos->second) : (typename Map::mapped_type{});
+}
+template <
+ class Map,
+ typename Key = typename Map::key_type,
+ typename Value = typename Map::mapped_type,
+ typename std::enable_if<!is_invocable<Value>::value>::type* = nullptr>
+typename Map::mapped_type
+get_default(const Map& map, const Key& key, Value&& dflt) {
+ auto pos = map.find(key);
+ if (pos != map.end()) {
+ return pos->second;
+ } else {
+ // if elision from function parameters was allowed, then we could make the
+ // third parameter a value parameter and just elide that into the return
+ // value, but sadly that is not allowed (yet)
+ return std::forward<Value>(dflt);
+ }