deque::clear
에 있지 않은 deque의 모든 요소를 지웁니다.
void clear( );
예제
// deque_clear.cpp
// compile with: /EHsc
#include <deque>
#include <iostream>
int main( )
{
using namespace std;
deque <int> c1;
c1.push_back( 10 );
c1.push_back( 20 );
c1.push_back( 30 );
cout << "The size of the deque is initially " << c1.size( ) << endl;
c1.clear( );
cout << "The size of the deque after clearing is " << c1.size( ) << endl;
}
요구 사항
헤더: <deque>
네임 스페이스: std