Files
TL/include/tl/algorithm/adjacent_find.h
jeanlemotan 8297b0b45f First
2024-07-02 18:06:33 +02:00

31 lines
876 B
C++

#pragma once
#include "tl/detail/prologue.h"
#include "tl/iterator.h"
#include <algorithm>
namespace tl
{
//////////////////////////////////////////////////////////////////////////
// adjacent_find()
//
// Container-based version of the <algorithm> `std::adjacent_find()` function to
// find equal adjacent elements within a container.
template <typename Squence>
auto adjacent_find(Squence& sequence) noexcept -> decltype(tl::begin(sequence));
// Overload of adjacent_find() for using a predicate evaluation other than `==` as
// the function's test condition.
template <typename Sequence, typename BinaryPredicate>
auto adjacent_find(Sequence& sequence, BinaryPredicate&& p) noexcept -> decltype(tl::begin(sequence));
//////////////////////////////////////////////////////////////////////////
} // end namespace tl
#include "tl/detail/algorithm/adjacent_find.inl"