Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
e916d846
Commit
e916d846
authored
Nov 04, 2016
by
Wenzel Jakob
Browse files
minor: have enum::export_values() return a reference to *this as usual
parent
f1b44a05
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+2
-1
No files found.
include/pybind11/pybind11.h
View file @
e916d846
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment