Skip to content

vector_pro::crbegin

C++
const_iterator_pro<value_type> crbegin() const noexcept;

Return const_iterator to reverse beginning

Returns a const_iterator_pro pointing to the last element in the container and grows in a reverse way.

Parameters

none

Return value

A const_iterator_pro to the reverse beginning of the sequence.

Example

C++
// vector_pro::crbegin/crend
#include <iostream>
#include "vector_pro.h"

/**
 * Output:
 * myvector backwards: 5 4 3 2 1
 */

int main ()
{
  vector_pro<int> myvector = {1,2,3,4,5};

  std::cout << "myvector backwards:";
  for (auto rit = myvector.crbegin(); rit != myvector.crend(); ++rit)
    std::cout << ' ' << *rit;
  std::cout << '\n';

  return 0;
}

Complexity

Constant.