| 85 | // transform_map_values((*2), {0: 2, 1: 3}) == {0: 4, 1: 6} |
| 86 | template <typename F, typename MapIn> |
| 87 | auto transform_map_values(F f, const MapIn& map) |
| 88 | { |
| 89 | using MapInPair = typename MapIn::value_type; |
| 90 | using Key = std::remove_const_t<typename MapInPair::first_type>; |
| 91 | using InVal = std::remove_const_t<typename MapInPair::second_type>; |
| 92 | using OutVal = std::decay_t<internal::invoke_result_t<F, InVal>>; |
| 93 | using MapOut = typename internal::SameMapTypeNewTypes<MapIn, Key, OutVal>::type; |
| 94 | |
| 95 | return pairs_to_map<MapOut>( |
| 96 | transform( |
| 97 | bind_1st_of_2(transform_snd<Key, InVal, F>, f), |
| 98 | map_to_pairs(map))); |
| 99 | } |
| 100 | |
| 101 | // API search type: map_union_with : (((val, val) -> val), Map key val, Map key val) -> Map key val |
| 102 | // fwd bind count: 2 |
no test coverage detected