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

Method convert_elements

include/pybind11/stl.h:327–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

325 void reserve_maybe(const sequence &, void *) {}
326
327 bool convert_elements(handle seq, bool convert) {
328 auto s = reinterpret_borrow<sequence>(seq);
329 value.clear();
330 reserve_maybe(s, &value);
331 for (const auto &it : seq) {
332 value_conv conv;
333 if (!conv.load(it, convert)) {
334 return false;
335 }
336 value.push_back(cast_op<Value &&>(std::move(conv)));
337 }
338 return true;
339 }
340
341public:
342 template <typename T>

Callers

nothing calls this directly

Calls 5

reserve_maybeFunction · 0.85
moveFunction · 0.85
clearMethod · 0.45
loadMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected