mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +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 });
|
||||
}
|
||||
template <typename Iterator,
|
||||
typename KeyType = decltype(std::declval<Iterator>()->first),
|
||||
typename KeyType = decltype((*std::declval<Iterator>()).first),
|
||||
typename... Extra>
|
||||
iterator make_key_iterator(Iterator first, Iterator last, Extra &&... extra) {
|
||||
typedef detail::iterator_state<Iterator, true> state;
|
||||
@ -1164,7 +1164,7 @@ iterator make_key_iterator(Iterator first, Iterator last, Extra &&... extra) {
|
||||
s.first = false;
|
||||
if (s.it == s.end)
|
||||
throw stop_iteration();
|
||||
return s.it->first;
|
||||
return (*s.it).first;
|
||||
}, return_value_policy::reference_internal, std::forward<Extra>(extra)...);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user