mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 05:05:11 +00:00
add missing instructor for bool_
This commit is contained in:
parent
f2331666d1
commit
4ee0f2a19e
@ -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; }
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user