mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-02 13:15:52 +08:00
allow enums values to be cast to integers
This commit is contained in:
parent
ac0fde988a
commit
6918922332
@ -812,6 +812,7 @@ public:
|
|||||||
((it == entries->end()) ? std::string("???")
|
((it == entries->end()) ? std::string("???")
|
||||||
: std::string(it->second));
|
: std::string(it->second));
|
||||||
});
|
});
|
||||||
|
this->def("__int__", [](Type value) { return (int) value; });
|
||||||
m_entries = entries;
|
m_entries = entries;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user