From db783f5815b2bf7dd7bc74c4b610eb92f7c5151c Mon Sep 17 00:00:00 2001 From: Anton Karpov Date: Wed, 5 Aug 2026 06:16:33 +0300 Subject: [PATCH] Fix \fn and \param tags in the searching algorithms 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. --- include/boost/algorithm/searching/boyer_moore.hpp | 5 ++--- .../algorithm/searching/boyer_moore_horspool.hpp | 1 - .../algorithm/searching/knuth_morris_pratt.hpp | 13 ++++++------- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/include/boost/algorithm/searching/boyer_moore.hpp b/include/boost/algorithm/searching/boyer_moore.hpp index e3c0010..87a413d 100644 --- a/include/boost/algorithm/searching/boyer_moore.hpp +++ b/include/boost/algorithm/searching/boyer_moore.hpp @@ -108,12 +108,11 @@ Requirements: typename traits::skip_table_t skip_; std::vector suffix_; - /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p ) + /// \fn do_search ( corpusIter corpus_first, corpusIter corpus_last ) /// \brief Searches the corpus for the pattern that was passed into the constructor - /// + /// /// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_last One past the end of the data to search - /// \param p A predicate used for the search comparisons. /// template std::pair diff --git a/include/boost/algorithm/searching/boyer_moore_horspool.hpp b/include/boost/algorithm/searching/boyer_moore_horspool.hpp index b8038fd..2c0afc3 100644 --- a/include/boost/algorithm/searching/boyer_moore_horspool.hpp +++ b/include/boost/algorithm/searching/boyer_moore_horspool.hpp @@ -107,7 +107,6 @@ http://www-igm.univ-mlv.fr/%7Elecroq/string/node18.html /// /// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_last One past the end of the data to search - /// \param k_corpus_length The length of the corpus to search /// template std::pair diff --git a/include/boost/algorithm/searching/knuth_morris_pratt.hpp b/include/boost/algorithm/searching/knuth_morris_pratt.hpp index 4c93fff..f25f13a 100644 --- a/include/boost/algorithm/searching/knuth_morris_pratt.hpp +++ b/include/boost/algorithm/searching/knuth_morris_pratt.hpp @@ -62,12 +62,11 @@ namespace boost { namespace algorithm { ~knuth_morris_pratt () {} - /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p ) + /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last ) /// \brief Searches the corpus for the pattern that was passed into the constructor - /// + /// /// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_last One past the end of the data to search - /// \param p A predicate used for the search comparisons. /// template std::pair @@ -99,16 +98,16 @@ namespace boost { namespace algorithm { const difference_type k_pattern_length; std::vector skip_; - /// \fn operator ( corpusIter corpus_first, corpusIter corpus_last, Pred p ) + /// \fn do_search ( corpusIter corpus_first, corpusIter corpus_last, difference_type k_corpus_length ) /// \brief Searches the corpus for the pattern that was passed into the constructor - /// + /// /// \param corpus_first The start of the data to search (Random Access Iterator) /// \param corpus_last One past the end of the data to search - /// \param p A predicate used for the search comparisons. + /// \param k_corpus_length The length of the corpus to search /// template std::pair - do_search ( corpusIter corpus_first, corpusIter corpus_last, + do_search ( corpusIter corpus_first, corpusIter corpus_last, difference_type k_corpus_length ) const { difference_type match_start = 0; // position in the corpus that we're matching