From 4ee0f2a19e223bccb59054fcd7d976e06bc3f7fc Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sun, 29 Nov 2015 13:45:27 +0100 Subject: [PATCH] add missing instructor for bool_ --- include/pybind11/pytypes.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 7d7cd9f62..48e3d1f33 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h @@ -264,6 +264,7 @@ inline pybind11::str handle::str() const { class bool_ : public object { public: PYBIND11_OBJECT_DEFAULT(bool_, object, PyBool_Check) + bool_(bool value) : object(value ? Py_True : Py_False, true) { } operator bool() const { return m_ptr && PyLong_AsLong(m_ptr) != 0; } };