Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
1959d18c
Commit
1959d18c
authored
Apr 30, 2016
by
Wenzel Jakob
Browse files
fixed return value type in py::make_iterator
parent
772c6d54
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+1
-1
include/pybind11/pytypes.h
include/pybind11/pytypes.h
+1
-1
No files found.
include/pybind11/pybind11.h
View file @
1959d18c
...
@@ -1006,7 +1006,7 @@ template <typename Iterator, typename... Extra> iterator make_iterator(Iterator
...
@@ -1006,7 +1006,7 @@ template <typename Iterator, typename... Extra> iterator make_iterator(Iterator
if
(
!
detail
::
get_type_info
(
typeid
(
state
)))
{
if
(
!
detail
::
get_type_info
(
typeid
(
state
)))
{
class_
<
state
>
(
handle
(),
""
)
class_
<
state
>
(
handle
(),
""
)
.
def
(
"__iter__"
,
[](
state
&
s
)
->
state
&
{
return
s
;
})
.
def
(
"__iter__"
,
[](
state
&
s
)
->
state
&
{
return
s
;
})
.
def
(
"__next__"
,
[](
state
&
s
)
->
decltype
(
*
std
::
declval
<
Iterator
>
())
&
{
.
def
(
"__next__"
,
[](
state
&
s
)
->
decltype
(
*
std
::
declval
<
Iterator
>
())
{
if
(
s
.
it
==
s
.
end
)
if
(
s
.
it
==
s
.
end
)
throw
stop_iteration
();
throw
stop_iteration
();
return
*
s
.
it
++
;
return
*
s
.
it
++
;
...
...
include/pybind11/pytypes.h
View file @
1959d18c
...
@@ -285,7 +285,7 @@ public:
...
@@ -285,7 +285,7 @@ public:
bool
operator
==
(
const
iterator
&
it
)
const
{
return
*
it
==
**
this
;
}
bool
operator
==
(
const
iterator
&
it
)
const
{
return
*
it
==
**
this
;
}
bool
operator
!=
(
const
iterator
&
it
)
const
{
return
*
it
!=
**
this
;
}
bool
operator
!=
(
const
iterator
&
it
)
const
{
return
*
it
!=
**
this
;
}
const
handle
&
operator
*
()
const
{
handle
operator
*
()
const
{
if
(
!
ready
&&
m_ptr
)
{
if
(
!
ready
&&
m_ptr
)
{
auto
&
self
=
const_cast
<
iterator
&>
(
*
this
);
auto
&
self
=
const_cast
<
iterator
&>
(
*
this
);
self
.
advance
();
self
.
advance
();
...
...
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