3 #include <boost/range/iterator_range_core.hpp>
13 template <
typename Range,
typename Predicate>
24 template <
typename Container>
25 typename Container::value_type
26 back(
const Container& container)
30 auto i = begin(container);
31 auto iend = end(container);
34 for (++i; i != iend; ++i)
39 template<
typename Container,
typename Predicate>
40 void erase_if(Container& c,
const Predicate& p)
44 for (
auto i = begin(c); i != end(c); )
55 template <
typename Container>
56 typename Container::value_type
57 front(
const Container& container)
61 auto i = begin(container);
62 assert(i != end(container));
68 template <
typename Iterator,
typename Pred,
typename Less>
69 boost::iterator_range<Iterator>
74 for (
auto i = begin;; ++i)
76 auto next = std::next(i);
90 template <
typename Container,
typename Compare>
93 auto i = std::begin(container);
94 auto end = std::end(container);
98 for (++i; i != end; ++i)
109 template <
typename Container>
110 typename Container::value_type
113 auto i = std::begin(container);
114 auto end = std::end(container);
119 for (++i; i != end; ++i)
130 template <
typename InputIt1,
typename InputIt2>
131 std::pair<InputIt1, InputIt2>
133 InputIt2 first2, InputIt2 last2)
135 while (first1 != last1
137 && *first1 == *first2)
142 return std::make_pair(first1, first2);
146 template <
typename Range,
typename Predicate>
155 template <
typename Range,
typename Value>
158 return none_of(r, [&value](
const Value&
v) {
return v == value; });
163 template <
typename Container>
167 if (x.size() != y.size())
170 using std::begin;
using std::end;
171 for (
auto xi = begin(x), xend = end(x), yi = begin(y);
174 if (x.key_comp()(xi->first, yi->first)
175 || x.key_comp()(yi->first, xi->first))
Container::value_type front(const Container &container)
The first member of this Container.
bool any_of(const Range &r, Predicate p)
Container::value_type back(const Container &container)
The last member of this Container.
Functor to compare Values of ValueSets.
bool is_sorted_forward(const Container &container, Compare comp)
Same as std::is_sorted, but works with an input iterator, not just a forward iterator.
std::pair< InputIt1, InputIt2 > mismatch(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2)
Same as C++14's mismatch, which is not available in G++-4.8 with -std=c++1y.
void erase_if(Container &c, const Predicate &p)
Provide a variadic mul on top of a binary mul(), and one().
bool none_of_equal(const Range &r, const Value &value)
bool none_of(const Range &r, Predicate p)
bool same_domain(const Container &x, const Container &y)
Check that two associative containers have the same keys.
boost::iterator_range< Iterator > initial_sorted_range(Iterator begin, Iterator end, Pred pred, Less less)
The return the longest initial range of elements matching the predicate.
Container::value_type max_forward(const Container &container)
Same as *std::max_element, but works with an input iterator, not just a forward iterator.