1 /* Copyright (c) 2015-2022. The SimGrid Team.
2 * All rights reserved. */
4 /* This program is free software; you can redistribute it and/or modify it
5 * under the terms of the license (GNU LGPL) which comes with this package. */
7 #ifndef SIMGRID_UTIL_HTPP
8 #define SIMGRID_UTIL_HTPP
12 namespace simgrid::util {
14 /** Find a pointer to a value stores in a map (or nullptr) */
15 template<typename C, typename K>
17 typename C::mapped_type* find_map_ptr(C& c, K const& k)
26 template<typename C, typename K>
28 typename C::mapped_type const* find_map_ptr(C const& c, K const& k)
30 typename C::const_iterator i = c.find(k);
37 } // namespace simgrid::util