25 Algorithms library [algorithms]

25.6 Non-modifying sequence operations [alg.nonmodifying]

25.6.15 Ends with [alg.ends.with]

template<input_­iterator I1, sentinel_­for<I1> S1, input_­iterator I2, sentinel_­for<I2> S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> requires (forward_­iterator<I1> || sized_­sentinel_­for<S1, I1>) && (forward_­iterator<I2> || sized_­sentinel_­for<S2, I2>) && indirectly_­comparable<I1, I2, Pred, Proj1, Proj2> constexpr bool ranges::ends_with(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
Let N1 be last1 - first1 and N2 be last2 - first2.
Returns: false if , otherwise ranges::equal(std::move(first1) + (N1 - N2), last1, std::move(first2), last2, pred, proj1, proj2)
template<input_­range R1, input_­range R2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> requires (forward_­range<R1> || sized_­range<R1>) && (forward_­range<R2> || sized_­range<R2>) && indirectly_­comparable<iterator_t<R1>, iterator_t<R2>, Pred, Proj1, Proj2> constexpr bool ranges::ends_with(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {});
Let N1 be ranges​::​distance(r1) and N2 be ranges​::​distance(r2).
Returns: false if , otherwise ranges::equal(ranges::drop_view(ranges::ref_view(r1), N1 - N2), r2, pred, proj1, proj2)