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

28 lines
880 B
C++

#pragma once
#include "tl/detail/prologue.h"
#include "tl/iterator.h"
#include <algorithm>
namespace tl
{
//////////////////////////////////////////////////////////////////////////
// mismatch()
//
// Container-based version of the <algorithm> `std::mismatch()` function to
// return the first element where two ordered containers differ
template <typename C1, typename C2>
auto mismatch(C1& c1, C2& c2) noexcept -> std::pair<decltype(tl::begin(c1)), decltype(tl::begin(c2))>;
// Overload of mismatch() for using a predicate evaluation other than `==` as
// the function's test condition.
template <typename C1, typename C2, typename BinaryPredicate>
auto mismatch(C1& c1, C2& c2, BinaryPredicate&& p) noexcept -> std::pair<decltype(tl::begin(c1)), decltype(tl::begin(c2))>;
//////////////////////////////////////////////////////////////////////////
} // end namespace tl