| 206 | |
| 207 | template <typename T> |
| 208 | struct EnumWrapper { |
| 209 | PyEnumHead std::string to_string() const { |
| 210 | return members[static_cast<size_t>(value)]; |
| 211 | } |
| 212 | static PyObject* py_repr(PyObject* self) { |
| 213 | return py::cast( |
| 214 | std::string(name) + "." + |
| 215 | reinterpret_cast<EnumWrapper*>(self)->to_string()) |
| 216 | .release() |
| 217 | .ptr(); |
| 218 | } |
| 219 | |
| 220 | static PyObject* py_dump(PyObject* self) { |
| 221 | return py::cast(reinterpret_cast<EnumWrapper*>(self)->to_string()) |