| 944 | } |
| 945 | template <class MapContainer, typename Function> |
| 946 | std::pair<typename MapContainer::mapped_type* const, bool> |
| 947 | ComputeIfAbsentReturnAbsense(MapContainer* container, |
| 948 | const typename MapContainer::key_type& key, |
| 949 | Function compute_func) { |
| 950 | return ComputePairIfAbsentReturnAbsense(container, key, [&key, &compute_func] { |
| 951 | return std::make_pair(key, compute_func()); |
| 952 | }); |
| 953 | }; |
| 954 | |
| 955 | // Like the above but doesn't return a pair, just returns a pointer to the value. |
| 956 | // Example usage: |