... all_of(a.cbegin(), a.cend(), isGreaterThan10)) {
74 cout << "\n\nAll the elements in a are greater than 10";
75 }
76 else {
77 cout << "\n\nSome elements in a are not greater than 10";
78 }
79
80 // determine whether any of the elements of a are greater than 10
81 if (any_of(a.cbegin(), a.cend(), isGreaterThan10)) {
82 cout << "\n\nSome of the elements in a are greater than 10";
83 }
84 else {
85 cout << "\n\nNone of the elements in a are greater than 10";
86 }
87
88 // determine whether none of the elements of a are greater than 10
89 if (none_of(a.cbegin(), a.cend(), isGreaterThan10)) {
90 cout << "\n\nNone of the elements in a are greater than 10";
91 }
92 else {
93 cout << "\n\nSome of the elements in a are greater than 10";
94 }
95
96 // locate ...
Get C++ How to Program, 10/e now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.