Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
Next

The Boost Algorithm Library

Marshall Clow

Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

Table of Contents

Description and Rationale
Searching Algorithms
Boyer-Moore Search
Boyer-Moore-Horspool Search
Knuth-Morris-Pratt Search
C++11 Algorithms
all_of
any_of
none_of
one_of
is_sorted
is_partitioned
is_permutation
partition_point
partition_copy
copy_if
copy_n
iota
C++14 Algorithms
equal
mismatch
C++17 Algorithms
for_each_n
Other Algorithms
none_of_equal
one_of_equal
is_decreasing
is_increasing
is_strictly_decreasing
is_strictly_increasing
clamp
clamp_range
find_not
find_backward
find_not_backward
find_if_backward
find_if_not
find_if_not_backward
gather
hex
unhex
hex_lower
is_palindrome
is_partitioned_until
apply_reverse_permutation
apply_permutation
copy_until
copy_while
iota_n
power
Not-yet-documented C++17 Algorithms
Not-yet-documented Other Algorithms
Reference
Header <boost/algorithm/algorithm.hpp>
Header <boost/algorithm/apply_permutation.hpp>
Header <boost/algorithm/clamp.hpp>
Header <boost/algorithm/cxx11/all_of.hpp>
Header <boost/algorithm/cxx11/any_of.hpp>
Header <boost/algorithm/cxx11/copy_if.hpp>
Header <boost/algorithm/cxx11/copy_n.hpp>
Header <boost/algorithm/cxx11/find_if_not.hpp>
Header <boost/algorithm/cxx11/iota.hpp>
Header <boost/algorithm/cxx11/is_partitioned.hpp>
Header <boost/algorithm/cxx11/is_permutation.hpp>
Header <boost/algorithm/cxx14/is_permutation.hpp>
Header <boost/algorithm/cxx11/is_sorted.hpp>
Header <boost/algorithm/cxx11/none_of.hpp>
Header <boost/algorithm/cxx11/one_of.hpp>
Header <boost/algorithm/cxx11/partition_copy.hpp>
Header <boost/algorithm/cxx11/partition_point.hpp>
Header <boost/algorithm/cxx14/equal.hpp>
Header <boost/algorithm/cxx14/mismatch.hpp>
Header <boost/algorithm/cxx17/exclusive_scan.hpp>
Header <boost/algorithm/cxx17/for_each_n.hpp>
Header <boost/algorithm/cxx17/inclusive_scan.hpp>
Header <boost/algorithm/cxx17/reduce.hpp>
Header <boost/algorithm/cxx17/transform_exclusive_scan.hpp>
Header <boost/algorithm/cxx17/transform_inclusive_scan.hpp>
Header <boost/algorithm/cxx17/transform_reduce.hpp>
Header <boost/algorithm/find_backward.hpp>
Header <boost/algorithm/find_not.hpp>
Header <boost/algorithm/gather.hpp>
Header <boost/algorithm/hex.hpp>
Header <boost/algorithm/is_palindrome.hpp>
Header <boost/algorithm/is_partitioned_until.hpp>
Header <boost/algorithm/minmax.hpp>
Header <boost/algorithm/minmax_element.hpp>
Header <boost/algorithm/searching/boyer_moore.hpp>
Header <boost/algorithm/searching/boyer_moore_horspool.hpp>
Header <boost/algorithm/searching/knuth_morris_pratt.hpp>
Header <boost/algorithm/sort_subrange.hpp>
Header <boost/algorithm/string.hpp>
Header <boost/algorithm/string_regex.hpp>

Boost.Algorithm is a collection of general purpose algorithms. While Boost contains many libraries of data structures, there is no single library for general purpose algorithms. Even though the algorithms are generally useful, many tend to be thought of as "too small" for Boost.

An implementation of Boyer-Moore searching, for example, might take a developer a week or so to implement, including test cases and documentation. However, scheduling a review to include that code into Boost might take several months, and run into resistance because "it is too small". Nevertheless, a library of tested, reviewed, documented algorithms can make the developer's life much easier, and that is the purpose of this library.

Future plans

I will be soliciting submissions from other developers, as well as looking through the literature for existing algorithms to include. The Adobe Source Library, for example, contains many useful algorithms that already have documentation and test cases. Knuth's The Art of Computer Programming is chock-full of algorithm descriptions, too.

My goal is to run regular algorithm reviews, similar to the Boost library review process, but with smaller chunks of code.

Dependencies

Boost.Algorithm uses Boost.Range, Boost.Assert, Boost.Array, Boost.TypeTraits, and Boost.StaticAssert.

Acknowledgements

Thanks to all the people who have reviewed this library and made suggestions for improvements. Steven Watanabe and Sean Parent, in particular, have provided a great deal of help.

Last revised: December 02, 2021 at 06:53:05 GMT


Next