From c5a1c8a6b95db9a9117cf14c50cf18d48aab944f Mon Sep 17 00:00:00 2001 From: Ivan Smirnov Date: Wed, 24 Aug 2016 23:27:19 +0100 Subject: [PATCH] Don't require operator-> for key iterators --- include/pybind11/pybind11.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index d82ae926..8fcdc493 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1149,7 +1149,7 @@ iterator make_iterator(Iterator first, Iterator last, Extra &&... extra) { return (iterator) cast(state { first, last, true }); } template ()->first), + typename KeyType = decltype((*std::declval()).first), typename... Extra> iterator make_key_iterator(Iterator first, Iterator last, Extra &&... extra) { typedef detail::iterator_state 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)...); }