list::assign

Code

 

Note:

The first member function replaces the sequence controlled by *this with the sequence [First, Last). The second member function replaces the sequence controlled by *this with a repetition of n elements of value x. The third member function removes the element of the controlled sequence pointed to by It. The fourth member function removes the elements of the controlled sequence in the range [First, Last). Both return an iterator that designates the first element remaining beyond any elements removed, or end if no such element exists. The last member function returns true for an empty controlled sequence.

 

Code

 

Output :
1 2 3
1 1 1 1
1 1 1
All gone

 

posted @ 2009-11-08 20:11  大Vin  阅读(524)  评论(0编辑  收藏  举报