add missing instructor for bool_

This commit is contained in:
Wenzel Jakob 2015-11-29 13:45:27 +01:00
parent f2331666d1
commit 4ee0f2a19e

View File

@ -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; }
};