fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <iterator>
  4. using namespace std;
  5.  
  6. struct motor {
  7. int cycle;
  8. };
  9.  
  10. int main() {
  11. motor motors[10] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
  12. auto maxCycle = 10;
  13. auto allBelow = std::all_of(std::begin(motors), std::end(motors), [=](motor m) { return m.cycle < maxCycle; });
  14. cout << allBelow << endl;
  15. return 0;
  16. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
1