From 3d591e8f2f6d06176884f33cd271bdd3d65294b4 Mon Sep 17 00:00:00 2001 From: Jason Rhinelander Date: Sat, 18 Mar 2017 13:34:21 -0300 Subject: [PATCH] Document make_iterator/make_key_iterator This adds brief API documentation for make_iterator/make_key_iterator, specifically mentioning that it requires InputIterators. Closes #734. [skip ci] (no code change here) --- include/pybind11/pybind11.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index e90c69aee..9c7c11b46 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -1301,6 +1301,7 @@ NAMESPACE_END(detail) template detail::init init() { return detail::init(); } template detail::init_alias init_alias() { return detail::init_alias(); } +/// Makes a python iterator from a first and past-the-end C++ InputIterator. template iterator make_iterator(Type &value, Extra&&... extra) { return make_iterator(std::begin(value), std::end(value), extra...); } +/// Makes an iterator over the keys (`.first`) of a stl map-like container supporting +/// `std::begin()`/`std::end()` template iterator make_key_iterator(Type &value, Extra&&... extra) { return make_key_iterator(std::begin(value), std::end(value), extra...);