67 template <
typename IT,
typename FUN>
83 template <
typename IT,
typename FUN>
108 template <
typename Container
111 inline disable_if< can_IterForEach<Container>,
117 return std::for_each (unwrap(coll).begin()
124 template <
typename IT
127 inline enable_if< can_IterForEach<IT>,
131 return std::for_each (ii, IT(), doIt);
137 template <
typename Container
140 inline enable_if< can_STL_ForEach<Container>,
142 and_all (Container
const& coll, FUN predicate)
146 return and_all (unwrap(coll).begin()
152 template <
typename IT
155 inline enable_if< can_IterForEach<IT>,
159 return and_all (ii, IT(), predicate);
164 template <
typename Container
167 inline enable_if< can_STL_ForEach<Container>,
169 has_any (Container
const& coll, FUN predicate)
173 return has_any (unwrap(coll).begin()
179 template <
typename IT
182 inline enable_if< can_IterForEach<IT>,
186 return has_any (ii, IT(), predicate);
197 template <
typename CON,
typename FUN,
typename P1,
typename...ARGS>
199 for_each (CON
const& elements, FUN function, P1&& bind1, ARGS&& ...args)
201 for_each (elements, std::bind (function, std::forward<P1>(bind1), std::forward<ARGS> (args)...));
210 template <
typename CON,
typename FUN,
typename P1,
typename...ARGS>
212 and_all (CON
const& elements, FUN function, P1&& bind1, ARGS&& ...args)
214 return and_all (elements, std::bind<bool> (function, std::forward<P1>(bind1), std::forward<ARGS> (args)...));
223 template <
typename CON,
typename FUN,
typename P1,
typename...ARGS>
225 has_any (CON
const& elements, FUN function, P1&& bind1, ARGS&& ...args)
227 return has_any (elements, std::bind<bool> (function, std::forward<P1>(bind1), std::forward<ARGS> (args)...));
bool has_any(IT i, IT end, FUN predicate)
Existential quantification: check if any element of a collection satisfies the given predicate.
bool and_all(IT i, IT end, FUN predicate)
All quantification: check if all elements of a collection satisfy the given predicate.
disable_if< can_IterForEach< Container >, FUN > for_each(Container const &coll, FUN doIt)
operate on all elements of a STL container.
Helpers for type detection, type rewriting and metaprogramming.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...