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
c5a1c8a6
Commit
c5a1c8a6
authored
Aug 24, 2016
by
Ivan Smirnov
Browse files
Don't require operator-> for key iterators
parent
b692896f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
include/pybind11/pybind11.h
include/pybind11/pybind11.h
+2
-2
No files found.
include/pybind11/pybind11.h
View file @
c5a1c8a6
...
@@ -1149,7 +1149,7 @@ iterator make_iterator(Iterator first, Iterator last, Extra &&... extra) {
...
@@ -1149,7 +1149,7 @@ iterator make_iterator(Iterator first, Iterator last, Extra &&... extra) {
return
(
iterator
)
cast
(
state
{
first
,
last
,
true
});
return
(
iterator
)
cast
(
state
{
first
,
last
,
true
});
}
}
template
<
typename
Iterator
,
template
<
typename
Iterator
,
typename
KeyType
=
decltype
(
std
::
declval
<
Iterator
>()
->
first
),
typename
KeyType
=
decltype
(
(
*
std
::
declval
<
Iterator
>()
).
first
),
typename
...
Extra
>
typename
...
Extra
>
iterator
make_key_iterator
(
Iterator
first
,
Iterator
last
,
Extra
&&
...
extra
)
{
iterator
make_key_iterator
(
Iterator
first
,
Iterator
last
,
Extra
&&
...
extra
)
{
typedef
detail
::
iterator_state
<
Iterator
,
true
>
state
;
typedef
detail
::
iterator_state
<
Iterator
,
true
>
state
;
...
@@ -1164,7 +1164,7 @@ iterator make_key_iterator(Iterator first, Iterator last, Extra &&... extra) {
...
@@ -1164,7 +1164,7 @@ iterator make_key_iterator(Iterator first, Iterator last, Extra &&... extra) {
s
.
first
=
false
;
s
.
first
=
false
;
if
(
s
.
it
==
s
.
end
)
if
(
s
.
it
==
s
.
end
)
throw
stop_iteration
();
throw
stop_iteration
();
return
s
.
it
->
first
;
return
(
*
s
.
it
).
first
;
},
return_value_policy
::
reference_internal
,
std
::
forward
<
Extra
>
(
extra
)...);
},
return_value_policy
::
reference_internal
,
std
::
forward
<
Extra
>
(
extra
)...);
}
}
...
...
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