Skip to content

Commit 0429c34

Browse files
committed
Make AL function public on accelerated linear; inherit privately.
1 parent dcec570 commit 0429c34

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

include/boost/algorithm/searching/musser_nishanov.hpp

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class accelerated_linear
5454
}
5555
}
5656

57+
public:
5758
std::pair<CorpusIter, CorpusIter> AL(CorpusIter corpus_first, CorpusIter corpus_last) const
5859
{
5960
using std::find;
@@ -122,21 +123,12 @@ class accelerated_linear
122123
return make_pair(corpus_last, corpus_last);
123124
}
124125

125-
public:
126126
accelerated_linear(PatIter pat_first, PatIter pat_last) : pat_first(pat_first), pat_last(pat_last), k_pattern_length(std::distance(pat_first, pat_last))
127127
{
128128
if (k_pattern_length > 0)
129129
compute_next();
130130
}
131131

132-
/**
133-
* Run the search object on a corpus with forward or bidirectional iterators.
134-
*/
135-
std::pair<CorpusIter, CorpusIter>
136-
operator()(CorpusIter corpus_first, CorpusIter corpus_last) const
137-
{
138-
return AL(corpus_first, corpus_last);
139-
}
140132
};
141133

142134

@@ -150,10 +142,20 @@ typename disable_if<
150142
boost::is_base_of<std::random_access_iterator_tag, typename std::iterator_traits<CorpusIter>::iterator_category>,
151143
boost::mpl::bool_<Trait::suffix_size>
152144
>::type
153-
>::type> : public accelerated_linear<PatIter, CorpusIter, Trait>
145+
>::type> : private accelerated_linear<PatIter, CorpusIter, Trait>
154146
{
147+
using accelerated_linear<PatIter, CorpusIter, Trait>::AL;
155148
public:
156149
musser_nishanov(PatIter pat_first, PatIter pat_last) : accelerated_linear<PatIter, CorpusIter, Trait>(pat_first, pat_last) {}
150+
151+
/**
152+
* Run the search object on a corpus with forward or bidirectional iterators.
153+
*/
154+
std::pair<CorpusIter, CorpusIter>
155+
operator()(CorpusIter corpus_first, CorpusIter corpus_last) const
156+
{
157+
return AL(corpus_first, corpus_last);
158+
}
157159
};
158160

159161

0 commit comments

Comments
 (0)