14 #if defined(__cplusplus) && __cplusplus < 201103L
18 #error "This library needs at least a C++11 compliant compiler"
31 template <
typename CONTAINER,
typename FN>
32 inline bool any(
const CONTAINER& c,
const FN& f) {
33 for (
const typename CONTAINER::value_type& val : c) {
34 if (f(val))
return true;
40 template <
typename CONTAINER,
typename FN>
41 inline bool all(
const CONTAINER& c,
const FN& f) {
42 for (
const typename CONTAINER::value_type& val : c) {
43 if (!f(val))
return false;
49 template <
typename CONTAINER,
typename T>
50 inline bool contains(
const CONTAINER& c,
const T& x) {
51 for (
const typename CONTAINER::value_type& val : c) {
52 if (val == x)
return true;
Modified by Mark Goodsell goodsell@lpthe.jussieu.fr
Definition: ATLAS_SUSY_2018_16.cc:27
bool contains(const CONTAINER &c, const T &x)
Return true if x is found in container c, otherwise false.
Definition: Utils.h:50
bool any(const CONTAINER &c, const FN &f)
Return true if f(x) is true for any x in container c, otherwise false.
Definition: Utils.h:32
bool all(const CONTAINER &c, const FN &f)
Return true if f(x) is true for all x in container c, otherwise false.
Definition: Utils.h:41