deque::empty

Tests if a deque is empty.

bool empty( ) const;

Return Value

true if the deque is empty; false if the deque is not empty.

Example

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

int main( ) 
{
   using namespace std;
   deque <int> c1;

   c1.push_back( 10 );
   if ( c1.empty( ) )
      cout << "The deque is empty." << endl;
   else
      cout << "The deque is not empty." << endl;
}
The deque is not empty.

Requirements

Header: <deque>

Namespace: std

See Also

Reference

deque Class

Standard Template Library