Lines Matching defs:iterator
21 class str; class iterator;
59 Return an iterator equivalent to calling ``iter()`` in Python. The object
62 iterator begin() const;
64 iterator end() const;
602 /// STL iterator template used for tuple, list, sequence and dict
651 /// Lightweight iterator policy using just a simple pointer: see ``PySequence_Fast_ITEMS``
694 /// Python's dictionary protocol permits this to be a forward iterator
815 Wraps a Python iterator so that it can also be used as a C++ input iterator
817 Caveat: copying an iterator does not (and cannot) clone the internal
819 operator. This iterator should only be used to retrieve the current
822 class iterator : public object {
830 PYBIND11_OBJECT_DEFAULT(iterator, object, PyIter_Check)
832 iterator& operator++() {
837 iterator operator++(int) {
845 auto& self = const_cast<iterator &>(*this);
854 The value which marks the end of the iteration. ``it == iterator::sentinel()``
859 void foo(py::iterator it) {
860 while (it != py::iterator::sentinel()) {
866 static iterator sentinel() { return {}; }
868 friend bool operator==(const iterator &a, const iterator &b) { return a->ptr() == b->ptr(); }
869 friend bool operator!=(const iterator &a, const iterator &b) { return a->ptr() != b->ptr(); }
1395 inline iterator iter(handle obj) {
1398 return reinterpret_steal<iterator>(result);
1403 template <typename D> iterator object_api<D>::begin() const { return iter(derived()); }
1404 template <typename D> iterator object_api<D>::end() const { return iterator::sentinel(); }