上述的算法都很简单,我就不多说了。
我来分析一下find_first,find_first的源代码是这样的:
template<typename collection1t, typename collection2t>
inline iterator_range<
boost_string_typename result_iterator_of<collection1t>::type>
find_first(
collection1t& input,
const collection2t& search)
{
return first_finder(search)(
begin(input),end(input));
}