From e916d846bf90c0405fb57a70ad9b0b4cb9cacc1e Mon Sep 17 00:00:00 2001 From: Wenzel Jakob Date: Fri, 4 Nov 2016 16:51:14 +0100 Subject: [PATCH] minor: have enum::export_values() return a reference to *this as usual --- include/pybind11/pybind11.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index f89fae865..d845d18a7 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1215,13 +1215,14 @@ public: } /// Export enumeration entries into the parent scope - void export_values() { + enum_ &export_values() { PyObject *dict = ((PyTypeObject *) this->m_ptr)->tp_dict; PyObject *key, *value; ssize_t pos = 0; while (PyDict_Next(dict, &pos, &key, &value)) if (PyObject_IsInstance(value, this->m_ptr)) m_parent.attr(key) = value; + return *this; } /// Add an enumeration entry