Rajinder Yadav - Windows C++ Development Tools & Resources :Design, Code, Test, Deploy
STL Basics
STL Intro
Big 3 Rule
Namespace
Iterator
STL End Node
Size vs Capacity
Performance
Adaptors
Algorithmn
Functors
Containers
Container Adaptors
STL Reference
vector
list
deque
queue
stack
map
multimap
set
multiset
C++ Standard Type Library

#include <list>
template class Type, class Allocator=allocator<Type> > class list
Parameters
Type - Element data type.
Allocator - Memory allocator/deallocator, optional.

Constructors

list( )

explicit list( const Allocator& aloc );

explicit list( size_type count );

list( size_type count, const Type& val );

list( size_type count, const Type& val, const Allocator& aloc );

list( const list& src );

template
<class InputIterator>
list( InputIterator start, InputIterator end )
;

template
<class InputIterator >
list( InputIterator start, InputIterator end, 
const Allocator& aloc );

Parameters

  aloc  - Allocator class
  count - Initial elements in the list
  val   - Initialized value of elements
  src   - Source list to be copied.
  start - First element in the range
  end   - Last element in the range

Methods
assign()Erases elements from a deque and copies a new set of elements to the target deque.
back()Returns a reference to the last element.
begin()Returns a random-access iterator to the first element in the container.
clear()Remove all elements.
empty()Check if container is empty.
end()Returns a random-access iterator that points just beyond the end of the container.
erase()Removes an element or a range of elements from the specified positions.
front()Returns a reference to the first element.
get_allocator()Returns the allocator object.
insert()Inserts element or a number of elements at the specified position.
max_size()Get the maximum length.
merge()Removes the elements from the source list, inserts them into the destination list and order the elements.
pop_back()Remove the element from the tail.
pop_front()Remove the element from the head.
push_back()Insert element to the tail.
push_front()Insert element to the head.
rbegin()Get reverse iterator to the first element.
remove()Remove elements matching a specified value.
remove_if()Remove elements satisfying the specified predicate.
rend()Get reverse iterator to the end element.
resize()Set new size for a vector.
reverse()Reserves requested storage space in container.
size()Get the count of elements.
sort()Order the elements in ascending order or to some other order specifed by a function.
splice()Removes elements from source list and inserts them into the destination list.
swap()Swap elements between two vectors.
unique()Removes duplicate elements that are adjacent, or adjacent elements that satisfy a binary predicatet.


Usage
STL Home

Copyright © 2007 Rajinder Yadav, All rights reserved