commit | 4ee0f2a19e223bccb59054fcd7d976e06bc3f7fc | [log] [tgz] |
---|---|---|
author | Wenzel Jakob <wenzel@inf.ethz.ch> | Sun Nov 29 13:45:27 2015 +0100 |
committer | Wenzel Jakob <wenzel@inf.ethz.ch> | Sun Nov 29 13:47:10 2015 +0100 |
tree | f23e6074f4446bd9d4687575f24d0169e3a60b33 | |
parent | f2331666d1e706eeb269f245baa1f5cfbb916bc4 [diff] |
add missing instructor for bool_
diff --git a/include/pybind11/pytypes.h b/include/pybind11/pytypes.h index 7d7cd9f..48e3d1f 100644 --- a/include/pybind11/pytypes.h +++ b/include/pybind11/pytypes.h
@@ -264,6 +264,7 @@ 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; } };