| 349 | |
| 350 | template<typename T> |
| 351 | inline typename T::mapped_type map_find( |
| 352 | const T &map, const typename T::key_type &key, |
| 353 | const typename T::mapped_type &defval = typename T::mapped_type() |
| 354 | ) { |
| 355 | auto it = map.find(key); |
| 356 | return (it == map.end()) ? defval : it->second; |
| 357 | } |
| 358 | |
| 359 | template <class T, typename Fn> |
| 360 | static void for_each_(std::vector<T> &v, Fn func) |