deque::size
傳回項目數的佇列。
size_type size( ) const;
傳回值
雙向佇列的目前長度。
範例
// deque_size.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>
int main( )
{
using namespace std;
deque <int> c1;
deque <int>::size_type i;
c1.push_back( 1 );
i = c1.size( );
cout << "The deque length is " << i << "." << endl;
c1.push_back( 2 );
i = c1.size( );
cout << "The deque length is now " << i << "." << endl;
}
需求
標頭: <deque>
命名空間: std