mirror of
https://github.com/pybind/pybind11.git
synced 2025-02-16 21:57:55 +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 {
|
class bool_ : public object {
|
||||||
public:
|
public:
|
||||||
PYBIND11_OBJECT_DEFAULT(bool_, object, PyBool_Check)
|
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; }
|
operator bool() const { return m_ptr && PyLong_AsLong(m_ptr) != 0; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user