C ++ standard template library list

Source: Internet
Author: User

Lists stores elements in the linked list sequentially. Compared with vectors, lists allows fast insertion and deletion, but random access is slow.

Assign () assigns a value to the list
Back () returns the last element
Begin () returns the iterator pointing to the first element.
Clear () delete all elements
Empty () returns true if list is empty.
End () returns the iterator at the end.
Erase () deletes an element.
Front () returns the first element
Get_allocator () returns the list Configurator
Insert () inserts an element into the list.
Max_size () returns the maximum number of elements that a list can hold.
Merge () combines two lists
Pop_back () Delete the last element
Pop_front () deletes the first element
Push_back () adds an element to the end of the list.
Push_front () adds an element to the list header.
Rbegin () returns the reverse iterator pointing to the first element.
Remove () delete an element from the list
Remove_if () deletes an element based on the specified conditions.
Rend () points to the reverse iterator at the end of the list
Resize () changes the list size.
Reverse () Reverse the list element
Size () returns the number of elements in the list.
Sort () sorts the list
Splice () merges two lists
Swap () exchange two lists
Unique () deletes repeated elements in the list.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.