GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::span::rend(3) C++ Standard Libary std::span::rend(3)

std::span::rend - std::span::rend


constexpr reverse_iterator rend() const noexcept;


Returns a reverse iterator to the element following the last element of the reversed
span. It corresponds to the element preceding the first element of the non-reversed
span. This element acts as a placeholder, attempting to access it results in
undefined behavior.


range-rbegin-rend.svg


(none)


Reverse iterator to the element following the last element.


Constant.

// Run this code


#include <algorithm>
#include <iostream>
#include <span>
#include <string_view>


void ascending(const std::span<const std::string_view> data,
const std::string_view term)
{
std::for_each(data.begin(), data.end(),
[](const std::string_view x) { std::cout << x << " "; });
std::cout << term;
}


void descending(const std::span<const std::string_view> data,
const std::string_view term)
{
std::for_each(data.rbegin(), data.rend(),
[](const std::string_view x) { std::cout << x << " "; });
std::cout << term;
}


int main()
{
constexpr std::string_view bars[]{ "▁","▂","▃","▄","▅","▆","▇","█" };
ascending(bars, " ");
descending(bars, "\n");
}


▁ ▂ ▃ ▄ ▅ ▆ ▇ █ █ ▇ ▆ ▅ ▄ ▃ ▂ ▁


rbegin returns a reverse iterator to the beginning
(C++20) (public member function)
rend returns a reverse end iterator for a container or array
crend (function template)
(C++14)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.