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

This commit is contained in:
Wenzel Jakob 2016-11-04 16:51:14 +01:00
parent f1b44a051a
commit e916d846bf

View File

@ -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