Compartilhar via


list::empty

Testa se uma lista está vazia.

bool empty( ) const;

Valor de retorno

true se a lista estiver vazia; false se a lista não estiver vazia.

Exemplo

// list_empty.cpp
// compile with: /EHsc
#include <list>
#include <iostream>

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

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

Requisitos

Cabeçalho: <list>

Namespace: std

Consulte também

Referência

Classe list

Biblioteca de Modelos Padrão