mirror of
https://github.com/pybind/pybind11.git
synced 2026-03-14 20:27:47 +00:00
allow enums values to be cast to integers
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user