Opened 10 years ago

Closed 10 years ago

#7104 closed Bugs (fixed)

[algorithm] compile error boyer_morre_search

Reported by: Akira Takahashi <faithandbrave@…> Owned by: Marshall Clow
Milestone: To Be Determined Component: algorithm
Version: Boost 1.50.0 Severity: Problem
Keywords: Cc:

Description

compilation error with Range version boost::algorithm::boyer_moore_search. follow code:

#include <iostream>
#include <string>
#include <boost/algorithm/searching/boyer_moore.hpp>

int main()
{
    std::string text =
       "the stick, and made believe to worry it: then Alice dodged behind a";
    std::string pattern = "behind";

    // BM法で文字列検索
    decltype(text)::const_iterator it =
        boost::algorithm::boyer_moore_search(text, pattern); // error!

    if (it != text.end()) std::cout << "found" << std::endl;
    else                  std::cout << "not found" << std::endl;
}

Please see attached patch.

Attachments (1)

boyer_moore.patch (1.3 KB ) - added by Akira Takahashi <faithandbrave@…> 10 years ago.
fixed iterator type

Download all attachments as: .zip

Change History (3)

by Akira Takahashi <faithandbrave@…>, 10 years ago

Attachment: boyer_moore.patch added

fixed iterator type

comment:1 by Marshall Clow, 10 years ago

(In [79380]) Fixed range-based versions of Boyer-Moore; Added range-based versions of Boyer-Moore-Horspool and Knuth-Pratt-Morris; Refs #7104; will close when merged to release. Thanks to Akira Takahashi for the bug report!

comment:2 by Marshall Clow, 10 years ago

Resolution: fixed
Status: newclosed

(In [79538]) Merge Boost.Algorithm changes to release; Fixes #7104

Note: See TracTickets for help on using tickets.