| 78 | // data. |
| 79 | template <class T> |
| 80 | void enum_<T>::construct(PyObject* obj, converter::rvalue_from_python_stage1_data* data) |
| 81 | { |
| 82 | #if PY_VERSION_HEX >= 0x03000000 |
| 83 | T x = static_cast<T>(PyLong_AS_LONG(obj)); |
| 84 | #else |
| 85 | T x = static_cast<T>(PyInt_AS_LONG(obj)); |
| 86 | #endif |
| 87 | void* const storage = ((converter::rvalue_from_python_storage<T>*)data)->storage.bytes; |
| 88 | new (storage) T(x); |
| 89 | data->convertible = storage; |
| 90 | } |
| 91 | |
| 92 | template <class T> |
| 93 | inline enum_<T>& enum_<T>::value(char const* name, T x) |
no outgoing calls