Iros
 
Loading...
Searching...
No Matches
ends_with.h
Go to the documentation of this file.
1#pragma once
2
5
6namespace di::container {
7namespace detail {
9 template<concepts::InputIterator It, concepts::SentinelFor<It> Sent, concepts::InputIterator Jt,
10 concepts::SentinelFor<Jt> Jent, typename Pred = function::Equal, typename Proj = function::Identity,
11 typename Jroj = function::Identity>
15 constexpr auto operator()(It it, Sent ed, Jt jt, Jent fd, Pred pred = {}, Proj proj = {}, Jroj jroj = {}) const
16 -> bool {
17 auto n = container::distance(it, ed);
18 auto m = container::distance(jt, fd);
19 if (n < m) {
20 return false;
21 }
22
23 container::advance(it, n - m);
24 return container::equal(util::move(it), ed, util::move(jt), fd, util::ref(pred), util::ref(proj),
25 util::ref(jroj));
26 }
27
28 template<concepts::InputContainer Con, concepts::InputContainer Don, typename Pred = function::Equal,
29 typename Proj = function::Identity, typename Jroj = function::Identity>
30 requires((concepts::ForwardContainer<Con> || concepts::SizedContainer<Con>) &&
31 (concepts::ForwardContainer<Don> || concepts::SizedContainer<Don>) &&
32 concepts::IndirectlyComparable<meta::ContainerIterator<Con>, meta::ContainerIterator<Don>, Pred, Proj,
33 Jroj>)
34 constexpr auto operator()(Con&& a, Don&& b, Pred pred = {}, Proj proj = {}, Jroj jroj = {}) const -> bool {
36 util::ref(pred), util::ref(proj), util::ref(jroj));
37 }
38 };
39}
40
41constexpr inline auto ends_with = detail::EndsWithFunction {};
42}
43
44namespace di {
46}
Definition forward_iterator.h:10
Definition indirectly_comparable.h:10
Definition sized_sentinel_for.h:9
Definition sequence.h:13
Definition sequence.h:12
constexpr auto ends_with
Definition ends_with.h:41
constexpr auto distance
Definition distance.h:44
constexpr auto equal
Definition equal.h:46
constexpr auto end
Definition end.h:47
constexpr auto advance
Definition advance.h:62
constexpr auto begin
Definition begin.h:44
decltype(container::begin(util::declval< T & >())) ContainerIterator
Definition container_iterator.h:8
constexpr auto ref
Definition reference_wrapper.h:98
Definition zstring_parser.h:9
constexpr auto proj
Definition proj.h:59