MCPcopy Create free account
hub / github.com/Tessil/ordered-map / get_filled_hash_map

Method get_filled_hash_map

tests/utils.h:241–253  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

239
240template <typename HMap>
241inline HMap utils::get_filled_hash_map(std::size_t nb_elements) {
242 using key_tt = typename HMap::key_type;
243 using value_tt = typename HMap::mapped_type;
244
245 HMap map;
246 map.reserve(nb_elements);
247
248 for (std::size_t i = 0; i < nb_elements; i++) {
249 map.insert({utils::get_key<key_tt>(i), utils::get_value<value_tt>(i)});
250 }
251
252 return map;
253}
254
255template <class T>
256struct is_pair : std::false_type {};

Callers

nothing calls this directly

Calls 2

reserveMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected