py::builtins::range::cend

constexpr const_iterator cend() const;

Returns a constant iterator to one past the last value of the range.

Warning

Iterators of range don’t support operator -> as they are constructed on demand.

Tip

Equivalent to py::builtins::range::end.

digraph begin_end { node [ shape = Mrecord, height = 0, width = 0, fontname = "Courier New", fontsize = 10 ]; array [ label = < <TABLE BGCOLOR="lightgrey" BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="12"> <TR> <TD PORT="begin"></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD></TD> <TD PORT="end" STYLE="dotted" SIDES="TRB"></TD> </TR> </TABLE> >, shape = plaintext ] "begin" -> array:begin "end" -> array:end past_the_last [ label="Past the last element", fontname = "Helvetica", shape = plain ] past_the_last -> array:end [arrowhead="vee"] rank3 [style=invisible]; array -> rank3 [color=none] { rank = same; rank3; past_the_last; } }

Return value

A constant iterator to one past the last value.

Complexity

Constant.

Example

#include <pypp/builtins/range.hpp>
#include <pypp/builtins/print.hpp>

int main()
{
    py::range<int> range(4);
    py::print(*(range.cend() - 1));
}

Output:

3