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++0x algorithm names are taken from [3].

 

Non-standard algorithms lack the std prefix.

 

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