std::hive<T,Allocator>::rbegin, std::hive<T,Allocator>::crbegin - cppreference.com
From cppreference.com
reverse_iterator rbegin() noexcept; |
(1) | (since C++26) |
const_reverse_iterator rbegin() const noexcept; |
(2) | (since C++26) |
const_reverse_iterator crbegin() const noexcept; |
(3) | (since C++26) |
Returns a reverse iterator to the first element of the reversed hive. It corresponds to the last element of the non-reversed hive. If the hive is empty, the returned iterator is equal to rend().
Return value
Reverse iterator to the first element.
Complexity
Constant.
Notes
The underlying iterator of the returned reverse iterator is the end iterator. Hence the returned iterator is invalidated if and when the end iterator is invalidated.
Example
#include <algorithm> #include <hive> #include <iostream> #include <iterator> int main() { const std::hive<int> hive{1, 2, 3, 4, 5}; std::copy(hive.rbegin(), hive.rend(), std::ostream_iterator<int>(std::cout, " ")); std::cout << '\n'; }
Output:
See also
| returns a reverse iterator to the end (public member function) [edit] | |
| returns a reverse iterator to the beginning of a container or array (function template) [edit] |