py::builtins::list::rend¶
reverse_iterator rend(); // 1
const_reverse_iterator rend() const; // 2
Returns a reverse iterator to one past the last element of the reversed list.
Returns a constant reverse iterator to one past the last element of the reversed list.
Tip
(2) is equivalent to py::builtins::list::crend.
Return value¶
An reverse iterator to one past the last element of the reversed list.
A constant reverse iterator to one past the last element of the reversed list.
Complexity¶
Constant.
Example¶
#include <pypp/builtins/list.hpp>
#include <pypp/builtins/print.hpp>
int main()
{
py::list<int> list = {0, 0, 1, 3};
py::print(*(list.rend() - 1));
}
Output:
0