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

31 lines
935 B
C++

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