4#ifndef TETL_FUNCTIONAL_DEFAULT_SEARCHER_HPP
5#define TETL_FUNCTIONAL_DEFAULT_SEARCHER_HPP
7#include <etl/_algorithm/search.hpp>
8#include <etl/_functional/equal_to.hpp>
9#include <etl/_iterator/distance.hpp>
10#include <etl/_iterator/next.hpp>
11#include <etl/_utility/forward.hpp>
12#include <etl/_utility/pair.hpp>
19template <
typename ForwardIter,
typename Predicate =
equal_to<>>
28 template <
typename ForwardIter2>
29 constexpr auto operator()(ForwardIter2 f, ForwardIter2 l)
const ->
etl::
pair<ForwardIter2, ForwardIter2>
31 if (
auto i =
etl::search(f, l, _first, _last, _predicate); i != l) {
32 auto j =
etl::next(i,
etl::distance(_first, _last));
33 return etl::
pair<ForwardIter2, ForwardIter2>{i, j};
36 return etl::
pair<ForwardIter2, ForwardIter2>{l, l};
Definition adjacent_find.hpp:9
Default searcher. A class suitable for use with Searcher overload of etl::search that delegates the s...
Definition default_searcher.hpp:20
constexpr auto operator()(ForwardIter2 f, ForwardIter2 l) const -> etl::pair< ForwardIter2, ForwardIter2 >
Definition default_searcher.hpp:29
constexpr default_searcher(ForwardIter f, ForwardIter l, Predicate p=Predicate())
Definition default_searcher.hpp:21
Function object for performing comparisons. Unless specialised, invokes operator== on type T....
Definition equal_to.hpp:15
etl::pair is a class template that provides a way to store two heterogeneous objects as a single unit...
Definition pair.hpp:37