File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -1312,7 +1312,7 @@ class buffer : public object {
13121312public:
13131313 PYBIND11_OBJECT_DEFAULT (buffer, object, PyObject_CheckBuffer)
13141314
1315- buffer_info request (bool writable = false ) {
1315+ buffer_info request (bool writable = false ) const {
13161316 int flags = PyBUF_STRIDES | PyBUF_FORMAT;
13171317 if (writable) flags |= PyBUF_WRITABLE;
13181318 Py_buffer *view = new Py_buffer ();
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ TEST_SUBMODULE(buffers, m) {
7878 py::class_<Matrix>(m, " Matrix" , py::buffer_protocol ())
7979 .def (py::init<ssize_t , ssize_t >())
8080 // / Construct from a buffer
81- .def (py::init ([](py::buffer b) {
81+ .def (py::init ([](py::buffer const b) {
8282 py::buffer_info info = b.request ();
8383 if (info.format != py::format_descriptor<float >::format () || info.ndim != 2 )
8484 throw std::runtime_error (" Incompatible buffer format!" );
You can’t perform that action at this time.
0 commit comments