Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::span::rbegin(3)	      C++ Standard Libary	  std::span::rbegin(3)

NAME
       std::span::rbegin - std::span::rbegin

Synopsis
	  constexpr reverse_iterator rbegin() const noexcept;

	  Returns  a  reverse  iterator	 to  the first element of the reversed
       span. It	corresponds
	  to the last element of the non-reversed span.	If the span is	empty,
       the returned
	  iterator is equal to rend().

	  range-rbegin-rend.svg

Parameters
	  (none)

Return value
	  Reverse iterator to the first	element.

Complexity
	  Constant.

Example
       // Run this code

	#include <algorithm>
	#include <iostream>
	#include <iterator>
	#include <span>

	int main()
	{
	    constexpr	std::span<const	  char>	 code{	"@droNE_T0P_w$s@s#_SE-
       CRET_a,p^42!" };

	    auto hacker	= [](const unsigned O) { return	O-0141<120; };

	    std::copy_if(code.rbegin(),	code.rend(),
		std::ostream_iterator<const char>(std::cout), hacker);
	}

Output:
	password

See also
	  rend	  returns a reverse iterator to	the end
	  (C++20) (public member function)
	  rbegin  returns a reverse iterator to	the beginning of  a  container
       or array
	  crbegin (function template)
	  (C++14)

http://cppreference.com		  2022.07.31		  std::span::rbegin(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::span::rbegin&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help