Exercises def_buffer(Return (Class::*)(Args...) &)
| 494 | ~OneDBufferLRef() { delete[] m_data; } |
| 495 | // Exercises def_buffer(Return (Class::*)(Args...) &) |
| 496 | py::buffer_info get_buffer() & { |
| 497 | return py::buffer_info(m_data, |
| 498 | sizeof(float), |
| 499 | py::format_descriptor<float>::format(), |
| 500 | 1, |
| 501 | {m_n}, |
| 502 | {(py::ssize_t) sizeof(float)}); |
| 503 | } |
| 504 | }; |
| 505 | py::class_<OneDBufferLRef>(m, "OneDBufferLRef", py::buffer_protocol()) |
| 506 | .def(py::init<py::ssize_t>()) |
nothing calls this directly
no test coverage detected