py::builtins::range::rend

constexpr const_reverse_iterator rend() const;

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

Warning

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

Tip

Equivalent to py::builtins::range::crend.

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="rend" STYLE="dotted" SIDES="TLB"></TD> <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 PORT="rbegin"></TD> <TD PORT="end" STYLE="dotted" SIDES="TRB"></TD> </TR> </TABLE> >, shape = plaintext ] begin [label="begin"] end [label="end"] rbegin [label="rbegin"] rend [label="rend"] begin -> array:begin end -> array:end rbegin -> array:rbegin rend -> array:rend rank3 [style=invisible]; array -> rank3 [color=none] { rank = same; rank3; begin; end; } }

Return value

A constant reverse iterator to one past the last value of the reversed range.

Complexity

Constant.

Example

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

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

Output:

0