mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-26 23:22:01 +00:00
Don't require operator-> for key iterators
This commit is contained in:
parent
b692896fc7
commit
c5a1c8a6b9
@ -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) {
|
|||||||
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)...);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user