Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) Algorithm

 

Most algorithms can be found in the header file algorithm.h.

 

Algorithms can be modified by adapters, binders and negaters.

 

Prefer algorithm calls over hand-written loops [1][2].

 

Incomplete list of algorithms. The C++11 algorithm names are taken from [3].

 

Non-standard algorithms lack the std prefix.

 

  1. C++98C++11 std::accumulate
  2. C++98C++11 accumulate_if
  3. C++98C++11 std::adjacent_find
  4.  C++11 std::all_of
  5.  C++11 std::any_of
  6. C++98C++11 std::binary_search
  7. C++98C++11 std::copy
  8. C++98C++11 std::copy_backward
  9. C++98C++11 copy_if
  10.  C++11 std::copy_if
  11.  C++11 std::copy_n
  12. C++98C++11 std::count
  13. C++98C++11 std::count_if
  14. C++98C++11 std::equal
  15. C++98C++11 std::equal_range
  16. C++98C++11 std::fill
  17. C++98C++11 std::find
  18. C++98C++11 std::find_end
  19. C++98C++11 std::find_first_of
  20. C++98C++11 std::find_if
  21.  C++11 std::find_if_not
  22. C++98C++11 std::for_each
  23. C++98C++11 std::generate
  24. C++98C++11 std::generate_n
  25. C++98C++11 std::includes
  26. C++98C++11 std::inplace_merge
  27.  C++11 std::iota
  28.  C++11 std::is_heap
  29.  C++11 std::is_heap_until
  30.  C++11 std::is_sorted
  31.  C++11 std::is_sorted_until
  32. C++98C++11 std::iter_swap
  33. C++98C++11 std::lexicographical_compare
  34. C++98C++11 std::lower_bound
  35. C++98C++11 std::make_heap
  36. C++98C++11 std::max
  37. C++98C++11 std::max_element
  38. C++98C++11 std::merge
  39. C++98C++11 std::min
  40. C++98C++11 std::min_element
  41.  C++11 std::minmax
  42.  C++11 std::minmax_element
  43. C++98C++11 std::mismatch
  44.  C++11 std::move
  45.  C++11 std::move_backward
  46. C++98C++11 std::next_permutation
  47.  C++11 std::none_of
  48. C++98C++11 std::nth_element
  49. C++98C++11 std::partial_sort
  50.  C++11 std::partial_sort_copy
  51. C++98C++11 std::partition
  52.  C++11 std::partition_copy
  53.  C++11 std::partition_point
  54. C++98C++11 std::pop_heap
  55. C++98C++11 std::prev_permutation
  56. C++98C++11 std::push_heap
  57. C++98C++11 std::random_shuffle
  58. C++98C++11 std::remove
  59. C++98C++11 std::remove_copy
  60. C++98C++11 std::remove_copy_if
  61. C++98C++11 std::remove_if
  62. C++98C++11 std::replace
  63. C++98C++11 std::replace_copy
  64. C++98C++11 std::replace_copy_if
  65. C++98C++11 std::replace_if
  66. C++98C++11 std::reverse
  67. C++98C++11 std::reverse_copy
  68. C++98C++11 std::rotate
  69. C++98C++11 std::rotate_copy
  70. C++98C++11 std::search
  71. C++98C++11 std::search_n
  72. C++98C++11 std::set_difference
  73. C++98C++11 std::set_intersection
  74. C++98C++11 std::set_symmetric_difference
  75. C++98C++11 std::set_union
  76. C++98C++11 std::sort
  77. C++98C++11 std::sort_heap
  78. C++98C++11 std::stable_partition
  79. C++98C++11 std::stable_sort
  80. C++98C++11 std::swap
  81. C++98C++11 std::swap_ranges
  82. C++98C++11 std::transform
  83. C++98C++11 std::unique
  84. C++98C++11 std::unique_copy
  85. C++98C++11 std::upper_bound

 

 

 

 

 

References

 

  1. Bjarne Stroustrup. The C++ Programming Language (3rd edition). ISBN: 0-201-88954-4. Chapter 18.12.1: 'Prefer algorithms to loops'.
  2. Scott Meyers. Effective STL. ISBN: 0-201-74962-9. Item 43: 'Prefer algorithm calls over hand-written loops'
  3. Bjarne Stroustrup's C++0x FAQ page

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict