13 #ifndef RANGES_V3_ALGORITHM_MISMATCH_HPP
14 #define RANGES_V3_ALGORITHM_MISMATCH_HPP
22 #include <range/v3/algorithm/result_types.hpp>
32 #include <range/v3/utility/static_const.hpp>
34 #include <range/v3/detail/prologue.hpp>
40 template<
typename I1,
typename I2>
41 using mismatch_result = detail::in1_in2_result<I1, I2>;
43 RANGES_FUNC_BEGIN(mismatch)
56 "Use the
variant of ranges::mismatch that takes an upper bound for "
58 mismatch_result<I1, I2> RANGES_FUNC(mismatch)(I1 begin1,
65 for(; begin1 != end1; ++begin1, ++begin2)
68 return {begin1, begin2};
79 requires input_iterator<I1> AND sentinel_for<S1, I1> AND
80 input_iterator<I2> AND sentinel_for<S2, I2> AND
82 constexpr mismatch_result<I1, I2> RANGES_FUNC(mismatch)(I1 begin1,
90 for(; begin1 != end1 && begin2 != end2; ++begin1, ++begin2)
93 return {begin1, begin2};
97 template(
typename Rng1,
102 requires input_range<Rng1> AND
input_iterator<uncvref_t<I2Ref>> AND
105 projected<uncvref_t<I2Ref>, P2>>)
107 "Use the variant of ranges::mismatch that takes an upper bound for "
109 mismatch_result<borrowed_iterator_t<Rng1>, uncvref_t<I2Ref>>
110 RANGES_FUNC(mismatch)(Rng1 && rng1,
116 RANGES_DIAGNOSTIC_PUSH
117 RANGES_DIAGNOSTIC_IGNORE_DEPRECATED_DECLARATIONS
118 return (*
this)(begin(rng1),
120 static_cast<uncvref_t<I2Ref> &&
>(begin2),
124 RANGES_DIAGNOSTIC_POP
128 template(
typename Rng1,
133 requires input_range<Rng1> AND input_range<Rng2> AND
137 constexpr mismatch_result<borrowed_iterator_t<Rng1>, borrowed_iterator_t<Rng2>>
138 RANGES_FUNC(mismatch)(Rng1 && rng1,
144 return (*
this)(begin(rng1),
153 RANGES_FUNC_END(mismatch)
157 using ranges::mismatch;
158 using ranges::mismatch_result;
173 #include <range/v3/detail/epilogue.hpp>
template(typename Rng1, typename Rng2, typename C=equal_to, typename P1=identity, typename P2=identity)(requires input_range< Rng1 > AND input_range< Rng2 > AND indirect_relation< C
This is an overloaded member function, provided for convenience. It differs from the above function o...
CPP_concept sentinel_for
\concept sentinel_for
Definition: concepts.hpp:306
CPP_concept input_iterator
\concept input_iterator
Definition: concepts.hpp:362
CPP_concept indirect_relation
\concept indirect_relation
Definition: concepts.hpp:670
decltype(begin(declval(Rng &))) iterator_t
Definition: access.hpp:698
typename Fn::template invoke< Args... > invoke
Evaluate the invocable Fn with the arguments Args.
Definition: meta.hpp:541
bool_< T::type::value==U::type::value > equal_to
A Boolean integral constant wrapper around the result of comparing T::type::value and U::type::value ...
Definition: meta.hpp:237
Definition: comparisons.hpp:28
Definition: identity.hpp:25
Definition: variant.hpp:621