Demystifying C++ STL: A Comprehensive Overview for Programmers

Non-modify sequence operations

  1. std::all_of: The test conditions for all elements in the range
  2. std::any_of: Tests whether any element in the scope satisfies the criteria
  3. std::none_of: Tests if no element satisfies the condition
  4. std::for_each: Applies functionality to scope
  5. std::find: Finds values in the range
  6. std::find_if: Finds elements in the range
  7. std::find_if_not: Find elements in range (negative condition)
  8. std::find_end: Finds the last subsequence in the range
  9. std::find_first_of: Finds elements from a collection in scope
  10. std::adjacent_find: Finds equal neighbors in the range
  11. std::Count: The occurrence of values within the calculation range
  12. std::count_if: Returns the number of elements whose range meets the criteria
  13. std::mismatch: Returns two first positions with different ranges
  14. std::equal: Tests whether the elements in two ranges are equal
  15. std::is_permutation: Tests if the range is another permutation
  16. std::search: The search scope of the subsequence
  17. std::search_n: element

Modify a sequence operation

  1. std::copy: Copies the range of elements
  2. std::copy_n: Duplicate element
  3. std::copy_if: Copies some elements of the scope
  4. std::copy_backward: Copies the element range backwards
  5. std::move: Moves the range of elements
  6. std::move_backward: Moves the element range backwards
  7. std::swap: Swaps the value of two objects
  8. std::swap_ranges: Swaps the values of two ranges
  9. std::iter_swap: Swaps the value of the object that the two iterators point to
  10. std::transform: conversion range
  11. std::replace: Replace a value in the range
  12. std::replace_if: Replace a value in the range
  13. std::replace_copy: Copy range override value
  14. std::replace_copy_if: Copy range substitution value
  15. std::fill: Fills the range with a value
  16. std::fill_n: Fills the sequence with values
  17. std::generate: Generates a range value with a function
  18. std::generate_n: Generates sequence values with a function
  19. std::remove: Removes a value from the range
  20. std::remove_if: Removes an element from the scope
  21. remove_copy: The copy range is removed from the value
  22. remove_copy_if: Copy the range to delete the value
  23. std::unique: Removes consecutive duplicates in the range
  24. std::unique_copy: Replication scope to remove duplicates
  25. std::reverse: reverse range
  26. std::reverse_copy: Copy range reversed
  27. std::rotate: Rotates an element in the range to the left
  28. std::rotate_copy: The copy range rotates to the left
  29. std::random_shuffle: Randomly rearranges elements in the range
  30. std::shuffle: Use the generator to randomly rearrange elements in the range

Partition operations

  1. std::is_partitioned: Tests whether the range is partitioned
  2. std::p artition: The partition range is split into two
  3. std::stable_partition: The partition ranges to two – stable order
  4. partition_copy: The partition scope is divided into two
  5. partition_point: Obtain the partition point

sort

  1. std::sort: sorts the elements in the range
  2. std::stable_sort: Sort elements, preserve the equivalence order
  3. std::p artial_sort: Elements in a partially sorted range
  4. std::p artial_sort_copy: Copies and partially sorts ranges
  5. std::is_sorted: Checks if the range has been sorted
  6. std::is_sorted_until: Finds the first unsorted element in the range
  7. std::nth_element: Sort of elements in a range

Binary search (manipulation on partition ranges/sort ranges)

  1. std::lower_bound: Returns the iterator to the lower bound
  2. std::upper_bound: Returns the iterator to an upper limit
  3. std::equal_range: Gets the subrange of equal elements
  4. std::binary_search: Tests whether the values exist in sort order

Merge (operates within the sort range)

  1. std::merge: Merge sort ranges
  2. std::inplace_merge: Merges consecutive sort ranges
  3. std::includes: Tests whether the sort range includes another sort range
  4. std::set_union: The union of two sort ranges
  5. std::set_intersection: The intersection of two sort ranges
  6. std::set_difference: The difference between the two sort ranges
  7. std::set_symmetric_difference: The symmetrical difference between the two sort ranges

Heap operations

  1. std::p ush_heap: pushes elements into the heap range
  2. std::p op_heap: Heap-scoped pop-up element
  3. std::make_heap: from the range heap
  4. std::sort_heap: sorts heap elements
  5. std::is_heap: Tests whether the scope is heap or not
  6. std::is_heap_until: Finds the first element that is not in heap order
  7. std::max: Returns the maximum
  8. std::minmax: Returns the minimum and maximum elements
  9. std::min_element: Returns the smallest element in the range
  10. std::max_element: Returns the largest element in the range
  11. std::minmax_element: Returns the smallest and largest elements in the range

Other operations

  1. std::lexicographical_compare: lexical less than
  2. std::next_permutation: converts the range to the next permutation
  3. std::p rev_permutation: Converts the range to a previous permutation

All STL articles in C++

Considered one of the most sought-after skills in the industry, we have our own coding foundation, C++ STL, to train and master these concepts through an intense problem-solving process.