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
a7500317
Commit
a7500317
authored
Aug 29, 2015
by
Wenzel Jakob
Browse files
support strongly typed enum
parent
bce10fae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
include/pybind/pybind.h
include/pybind/pybind.h
+1
-1
No files found.
include/pybind/pybind.h
View file @
a7500317
...
...
@@ -742,7 +742,7 @@ public:
:
class_
<
Type
>
(
scope
,
name
,
doc
),
m_parent
(
scope
)
{
auto
entries
=
new
std
::
unordered_map
<
int
,
const
char
*>
();
this
->
def
(
"__str__"
,
[
name
,
entries
](
Type
value
)
->
std
::
string
{
auto
it
=
entries
->
find
(
value
);
auto
it
=
entries
->
find
(
(
int
)
value
);
return
std
::
string
(
name
)
+
"."
+
((
it
==
entries
->
end
())
?
std
::
string
(
"???"
)
:
std
::
string
(
it
->
second
));
...
...
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