Skip to main content

7.1) Lists


  • Lists are made available via #include <list>
  • Like vectors, they are useful for sequences of values where order is significant
  • They provide the same creation options as vectors
  • They provide comparable operations but don't support [] or the at method for element access
  • They support some operations that aren't available for vectors:

    push_front Adds an element with given value to the front of the list
    pop_front Removes an element from the front of the list
    unique Eliminates adjacent duplicate elements from the list
    reverse Reverses ordering of values in the list
    sort Sorts list contents into order

For more detailed information see the page on lists at cppreference.com.