From a7500317956457497c9d97e22276863554e2e3ad Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Sat, 29 Aug 2015 02:08:32 +0200 Subject: [PATCH] support strongly typed enum --- include/pybind/pybind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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));