Lines Matching defs:map
224 // Interface of a map-like object that isn't (directly) an unordered_map, but provides some basic
225 // map-like functionality.
230 : map(std::move(init)) {}
232 void set(std::string key, std::string val) { map[key] = val; }
233 std::string get(std::string key) const { return map.at(key); }
234 size_t size() const { return map.size(); }
236 std::unordered_map<std::string, std::string> map;
238 decltype(map.cbegin()) begin() const { return map.cbegin(); }
239 decltype(map.cend()) end() const { return map.cend(); }
244 .def("__getitem__", [](const StringMap &map, std::string key) {
245 try { return map.get(key); }
252 .def("__iter__", [](const StringMap &map) { return py::make_key_iterator(map.begin(), map.end()); },
254 .def("items", [](const StringMap &map) { return py::make_iterator(map.begin(), map.end()); },