an example of C++ STL alg all_of any_of none_of


👍 g++ -std=c++11 all_any_none.cpp
👍 ./a.out
true
true
true
👍 cat all_any_none.cpp 
#include <iostream>
#include <vector>
using namespace std;

int main() {
  vector<int> v{-2,0,2,4,6,8};
  auto b=v.begin(), e=v.end();
  cout << boolalpha; 

  bool all_even = all_of(b, e,
    [](int n){return n%2 == 0;});
  cout << all_even << endl;

  bool one_negative = any_of(b, e,
    [](int n){return n < 0;});
  cout << one_negative << endl;

  bool none_odd = none_of(b, e,
    [](int n){return n%2 != 0;});
  cout << none_odd << endl;
}