Exercises def_buffer(Return (Class::*)(Args...) const noexcept)
| 473 | ~OneDBufferConst() { delete[] m_data; } |
| 474 | // Exercises def_buffer(Return (Class::*)(Args...) const noexcept) |
| 475 | py::buffer_info get_buffer() const noexcept { |
| 476 | return py::buffer_info(m_data, |
| 477 | sizeof(float), |
| 478 | py::format_descriptor<float>::format(), |
| 479 | 1, |
| 480 | {m_n}, |
| 481 | {(py::ssize_t) sizeof(float)}, |
| 482 | /*readonly=*/true); |
| 483 | } |
| 484 | }; |
| 485 | py::class_<OneDBufferConst>(m, "OneDBufferConst", py::buffer_protocol()) |
| 486 | .def(py::init<py::ssize_t>()) |
nothing calls this directly
no test coverage detected