From 63495313066119dcf7510c2ae8b468b46c12ef8f Mon Sep 17 00:00:00 2001 From: "Ralf W. Grosse-Kunstleve" Date: Tue, 2 Feb 2021 13:47:46 -0800 Subject: [PATCH] Commenting out const in def_buffer(... const). With this, test_buffers builds and runs with PYBIND11_USE_SMART_HOLDER_AS_DEFAULT. Explanation why the const needs to be removed, or fix elsewhere, is still needed, but left for later. --- include/pybind11/pybind11.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 017b2c655e..a5aa055fad 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1409,7 +1409,8 @@ class class_ : public detail::generic_type { template class_ &def_buffer(Return (Class::*func)(Args...) const) { - return def_buffer([func] (const type &obj) { return (obj.*func)(); }); + // NEEDED: Explanation why the const needs to be removed, or fix elsewhere. + return def_buffer([func] (/*const*/ type &obj) { return (obj.*func)(); }); } template