MCPcopy Create free account
hub / github.com/pybind/pybind11 / convert_elements

Method convert_elements

include/pybind11/stl.h:237–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

235 void reserve_maybe(const dict &, void *) {}
236
237 bool convert_elements(const dict &d, bool convert) {
238 value.clear();
239 reserve_maybe(d, &value);
240 for (const auto &it : d) {
241 key_conv kconv;
242 value_conv vconv;
243 if (!kconv.load(it.first.ptr(), convert) || !vconv.load(it.second.ptr(), convert)) {
244 return false;
245 }
246 value.emplace(cast_op<Key &&>(std::move(kconv)), cast_op<Value &&>(std::move(vconv)));
247 }
248 return true;
249 }
250
251public:
252 bool load(handle src, bool convert) {

Callers

nothing calls this directly

Calls 5

reserve_maybeFunction · 0.85
moveFunction · 0.85
ptrMethod · 0.80
clearMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected