Function |
Describe |
void L.assign (int n, const val) void L.assign (it first, it last) |
Link list l initialized to n val element. l initialized to first to last it pointer with l is a type. Facilitates the copy for a contiguous element in another linked list to the new list. |
Reference L.back () |
Returns the last element. After testing, you can directly l.back () = element. |
It L.begin () |
Returns the address of a 1th element. |
Void L.clear () |
Clears the linked list. |
BOOL L.empty () |
Determines whether there are elements in the linked list, and if so, returns True. |
It L.end () |
Returns the address of the next element of the last element, that is, the address has no actual element. |
It l.erase (it pos); it l.erase (it first, it last); |
Removes the element pointed to by the it pointer in the linked list , returning the next element address of the deleted element. Deletes all elements from first to Last, and returns the address of the next element in the final deleted element. |
Reference L.front () |
Returns the first element. If a=l.front (), then a is just a backup, and a modification does not affect the list. |
Get_allocator () |
Never know what to do with this thing? |
It L.insert (it pos, element type val) void L.insert (it pos, int n, element type val) void L.insert (It pos, it first, it last) |
in pos val element, returns the address of the element. val In pos previous position insert n a val element. In pos previous position insert first to last |
Int l.max_size () |
Returns the maximum number of elements that a list can fit into, with a large number of general figures. As measured, the numbers already contain elements that exist in the list. |
void l.merge (list& x) void l.merge ( List& x, compare comp) |
Link list style= font-family: ' Times New Roman ';" >l l after merging the linked list x The element is 0 but x still exists. Merges the two linked lists together, according to comp |
list& l.operator= (const list& x) |
Assigns all the elements in the entire list x to the linked list l, which is equivalent to emptying the list Land assigning x to the past. Does not change the data of X. Note that the parameter x is inside the parentheses . |
void L.pop_back () |
Deletes the last element of the linked list. |
void L.pop_front () |
Deletes the first element of the list. |
void L.push_back (const value_type& val) |
Inserts an element Val into the tail of the list. |
void L.push_front (const value_type& val) |
Inserts the element Val to the head of the linked list. |
It L.rbegin () |
Returns the address of the 1 element of the reverse linked list . That is, returns the address of the last element of the linked list. |
void l.remove (const value_type& val) |
Delete value equals val erase |
void l.remove_if (predicate pred) |
Function: Removes the element. Each element in the linked list is passed into the pred function Separately, as long as the returned result is true, it is deleted. pred does not need parentheses, it is similar to Compin sort . |
It L.rend () |
Returns the next position of the last element of the reverse list, which may not be correct, and is used primarily for reverse linked list operations. The address is returned, and the address has no elements. |
void L.resize (size_type n, Value_type val = Value_type ()) |
Re-set the number of elements of the list, if large, will insert the default element, if less, or delete some elements. The standard is an existing element. |
Void L.reverse () |
Resets the order of all elements to the opposite, such as ascending to descending. |
Int l.size () |
Returns the number of elements that already exist, and if you have just called resize, The size is set by resize. |
Void L.sort (Comp) Void L.sort () |
Sort, as returned by the comp function, if true does not change the position, and false swaps the position. Sorting, sorted by default, is generally sequential, such as Integer, string comparison is ASCII code. |
void L.splice (It pos, list& x) void L.splice (It pos, list& x, it i) void L.splice (It pos, list& x, it first, it last) |
To "cut" all the elements in the list x to the pos , it is simply a pointer operation, without assigning a value. The element iin the chain table x is"clipped" to the pos , just a single element. Migrate the elements from first to last in the list x to pos in l Place. These actions will add new elements to the list l and delete the corresponding elements in x . |
void L.swap (list& x) |
The two lists are interchangeable names, the number of elements can be different, but the types are the same. |
Void l.unique () void l.unique (predicate pred) |
Removes duplicate redundant elements, making each element unique. The first of the same elements is not deleted. To pred function as the basis, delete duplicate elements, When pred return true |
bool operator== (list<t,alloc>& lhs,list<t, ALLOC>&&NBSP;RHS); bool operator!= (&NBSP;LIST<T,ALLOC>&&NBSP;LHS,&NBSP;LIST<T,ALLOC>&&NBSP;RHS) ; bool operator< (LIST<T,ALLOC>&&NBSP;LHS,LIST<T,ALLOC>&&NBSP;RHS); bool operator<= (LIST<T,ALLOC>&&NBSP;LHS,&NBSP;LIST<T,ALLOC>&&NBSP;RHS); bool operator> (list<t,alloc>& lhs, list<t,alloc>& RHS); bool operator>= ( list<T,Alloc>& lhs, list<T,Alloc>& RHS); |
A bunch of infrequently used symbols. Direct comparisons, such as a==b |
void swap (list<t,alloc>& x, list<t,alloc>& y) |
Exchange two linked lists. The same effect as the L.swap. |