fork download
  1. // any_of example
  2. #include <iostream> // std::cout
  3. #include <algorithm> // std::any_of
  4. #include <vector>
  5.  
  6. int main () {
  7. std::vector<bool> foo = {true, true, true};
  8.  
  9. if ( !std::any_of(foo.begin(), foo.end(), [](bool i){return i == false;}) )
  10. std::cout << "All elements are true\n";
  11.  
  12. return 0;
  13. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
All elements are true