Aracılığıyla paylaş


vector::empty

Vektör boş ise sınar.

bool empty( ) const;

Dönüş Değeri

gerçek vektör boşsa; yanlış vektör boş değilse.

Örnek

// vector_empty.cpp
// compile with: /EHsc
#include <vector>
#include <iostream>

int main( )
{
   using namespace std;   
   vector <int> v1;

   v1.push_back( 10 );

   if ( v1.empty( ) )
      cout << "The vector is empty." << endl;
   else
      cout << "The vector is not empty." << endl;
}
  

Gereksinimler

Başlık: <vector>

Namespace: std

Ayrıca bkz.

Başvuru

vector Class

vector::empty, vector::erase, ve vector::push_back

Standart Şablon Kütüphanesi