diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index b35b2fc77..7bdf91372 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1123,7 +1123,7 @@ PYBIND11_NOINLINE inline void keep_alive_impl(int Nurse, int Patient, handle arg keep_alive_impl(nurse, patient); } -template +template struct iterator_state { Iterator it; Sentinel end; @@ -1139,10 +1139,10 @@ template ()), typename... Extra> iterator make_iterator(Iterator first, Sentinel last, Extra &&... extra) { - typedef detail::iterator_state state; + typedef detail::iterator_state state; if (!detail::get_type_info(typeid(state))) { - class_(handle(), "") + class_(handle(), "iterator") .def("__iter__", [](state &s) -> state& { return s; }) .def("__next__", [](state &s) -> ValueType { if (!s.first) @@ -1157,15 +1157,16 @@ iterator make_iterator(Iterator first, Sentinel last, Extra &&... extra) { return (iterator) cast(state { first, last, true }); } + template ()).first), typename... Extra> iterator make_key_iterator(Iterator first, Sentinel last, Extra &&... extra) { - typedef detail::iterator_state state; + typedef detail::iterator_state state; if (!detail::get_type_info(typeid(state))) { - class_(handle(), "") + class_(handle(), "iterator") .def("__iter__", [](state &s) -> state& { return s; }) .def("__next__", [](state &s) -> KeyType { if (!s.first)