diff --git a/include/pybind/pybind.h b/include/pybind/pybind.h index f2d366a6f..5960a453f 100644 --- a/include/pybind/pybind.h +++ b/include/pybind/pybind.h @@ -742,7 +742,7 @@ public: : class_(scope, name, doc), m_parent(scope) { auto entries = new std::unordered_map(); 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));