method iter.all
true if every element satisfies p (also for an empty sequence); stops at the first element that does not.
Example:
fn main() io {
print("{[1, 2, 3].iter().all(x => x > 0)} {[1, 2, 3].iter().all(x => x > 1)}")
}Output
true false
pub(api) move fn all<effect F>(p: fn(T) -> bool F) -> bool FComplexity. O(n) at worst.
Since. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
p | fn(T) -> bool F |
Returns
bool F
Effects
none declared (pure unless the body says otherwise)
Defined in: std/core/iter.oxl:705