Dela via


deque::crbegin

Returns a const iterator to the first element in a reversed deque.

const_reverse_iterator crbegin( ) const;

Return Value

A const reverse random-access iterator addressing the first element in a reversed deque Class or addressing what had been the last element in the unreversed deque.

Remarks

With the return value of crbegin, the deque object cannot be modified.

Example

// deque_crbegin.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>

int main( )
{
   using namespace std;   
   deque <int> v1;
   deque <int>::iterator v1_Iter;
   deque <int>::const_reverse_iterator v1_rIter;
   
   v1.push_back( 1 );
   v1.push_back( 2 );

   v1_Iter = v1.begin( );
   cout << "The first element of deque is "
        << *v1_Iter << "." << endl;

   v1_rIter = v1.crbegin( );
   cout << "The first element of the reversed deque is "
        << *v1_rIter << "." << endl;
}
The first element of deque is 1.
The first element of the reversed deque is 2.

Requirements

Header: <deque>

Namespace: std

See Also

Reference

deque Class

Standard Template Library

Other Resources

deque Class Members