Commit a7500317 authored by Wenzel Jakob's avatar Wenzel Jakob
Browse files

support strongly typed enum

parent bce10fae
......@@ -742,7 +742,7 @@ public:
: class_<Type>(scope, name, doc), m_parent(scope) {
auto entries = new std::unordered_map<int, const char *>();
this->def("__str__", [name, entries](Type value) -> std::string {
auto it = entries->find(value);
auto it = entries->find((int) value);
return std::string(name) + "." +
((it == entries->end()) ? std::string("???")
: std::string(it->second));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment