#ifndef SPROUT_ALGORITHM_SEARCH_N_HPP #define SPROUT_ALGORITHM_SEARCH_N_HPP #include #include #include #include #include #include namespace sprout { // 25.2.13 Search // // recursion depth: // O(log(N1+N2)) // template inline SPROUT_CONSTEXPR ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, T const& value, BinaryPredicate pred) { typedef sprout::value_iterator iterator; return sprout::search( first, last, iterator(value, static_cast::difference_type>(count)), iterator(value, 0), pred ); } template inline SPROUT_CONSTEXPR ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, T const& value) { return sprout::search_n(first, last, count, value, sprout::equal_to<>()); } } // namespace sprout #endif // #ifndef SPROUT_ALGORITHM_SEARCH_N_HPP