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

Method get_buffer

tests/test_buffers.cpp:536–543  ·  view source on GitHub ↗

Exercises def_buffer(Return (Class::*)(Args...) & noexcept)

Source from the content-addressed store, hash-verified

534 ~OneDBufferLRefNoexcept() { delete[] m_data; }
535 // Exercises def_buffer(Return (Class::*)(Args...) & noexcept)
536 py::buffer_info get_buffer() & noexcept {
537 return py::buffer_info(m_data,
538 sizeof(float),
539 py::format_descriptor<float>::format(),
540 1,
541 {m_n},
542 {(py::ssize_t) sizeof(float)});
543 }
544 };
545 py::class_<OneDBufferLRefNoexcept>(m, "OneDBufferLRefNoexcept", py::buffer_protocol())
546 .def(py::init<py::ssize_t>())

Callers

nothing calls this directly

Calls 1

buffer_infoClass · 0.85

Tested by

no test coverage detected