Dela via


deque::cend

Returns the past-the-end iterator.

const_iterator cend( ) const;

Return Value

The const past-the-end iterator for the deque. If the deque is empty, deque::cend() == deque::cbegin().

Remarks

With the return value of deque::cend (suitably decremented), the deque Class object cannot be modified.

Example

// deque_cend.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>
int main( )
{
   using namespace std;
   deque <int> v1;
   deque <int>::const_iterator v1_Iter;
   
   v1.push_back( 1 );
   v1.push_back( 2 );

   for ( v1_Iter = v1.cbegin( ) ; v1_Iter != v1.cend( ) ; v1_Iter++ )
      cout << *v1_Iter << endl;
}
1
2

Requirements

Header: <deque>

Namespace: std

See Also

Reference

deque Class

Standard Template Library

Other Resources

deque Class Members