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