The four searchers share copied comment blocks, and three of them kept
names from a function they no longer describe.
boyer_moore and knuth_morris_pratt document a predicate parameter Pred p
that none of the operators or do_search overloads take. boyer_moore also
names the block \fn operator while it sits on do_search, and so does one
of the two blocks in knuth_morris_pratt, where the real third parameter
is k_corpus_length rather than p. boyer_moore_horspool documents
k_corpus_length on a do_search that takes two arguments.
The correct form is already in the same family: boyer_moore.hpp:73 and
boyer_moore_horspool.hpp:68 both name two parameters and no predicate.
The three-argument overload documents `\param last2`, but its parameters
are `first1`, `last1`, `first2` — `last2` is a local variable computed
inside the body. The four-argument overload right above it documents
`last1` correctly.
Both `\fn` lines also spell the first two parameters `first` and `last`
while the declarations use `first1` and `last1`.
Problem:
- There is no way to signal that a copy should proceed, selecting
elements by a predicate until some condition is met. This is useful
for patterns along the lines of "copy selected elements until there
are n total elements in the output".
Solution:
- Introduce `copy_if_while()` and `copy_if_until()`.
Problem:
- There is no documentation for the existing functions. This will make
it harder for users to consume these functions, espcially as new
variants are added.
Solution:
- Add documentation.
Problem:
- There is no documentation for the existing functions. This will make
it harder for users to consume these functions, especially as new
variants are added.
Solution:
- Add documentation.
On compilers that support C++11, this allows both lvalues and rvalues to be used as inputs to the split(), find_all(), and ifind_all() functions.
For example, given a function get_string() that returns a std::string, this allows you to write:
boost::split(result, get_string(), boost::is_any_of(" "))