Commit e916d846 by Wenzel Jakob

minor: have enum::export_values() return a reference to *this as usual

parent f1b44a05
...@@ -1215,13 +1215,14 @@ public: ...@@ -1215,13 +1215,14 @@ public:
} }
/// Export enumeration entries into the parent scope /// Export enumeration entries into the parent scope
void export_values() { enum_ &export_values() {
PyObject *dict = ((PyTypeObject *) this->m_ptr)->tp_dict; PyObject *dict = ((PyTypeObject *) this->m_ptr)->tp_dict;
PyObject *key, *value; PyObject *key, *value;
ssize_t pos = 0; ssize_t pos = 0;
while (PyDict_Next(dict, &pos, &key, &value)) while (PyDict_Next(dict, &pos, &key, &value))
if (PyObject_IsInstance(value, this->m_ptr)) if (PyObject_IsInstance(value, this->m_ptr))
m_parent.attr(key) = value; m_parent.attr(key) = value;
return *this;
} }
/// Add an enumeration entry /// Add an enumeration entry
......
Markdown is supported
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