mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-01-21 22:33:24 +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("???")
|
||||
: std::string(it->second));
|
||||
});
|
||||
this->def("__int__", [](Type value) { return (int) value; });
|
||||
m_entries = entries;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user