OxL Reference

method iter.count

Number of elements (pulls them all).

Example:

oxl✓ checked in CI
fn main() io {
  print("{[1, 2, 3].iter().filter(x => x > 1).count()}")
}
Output
2
pub(api) move fn count() -> usize

Complexity. O(n).

Since. 1.0.0-beta

Returns

usize

Effects

none declared (pure unless the body says otherwise)

Defined in: std/core/iter.oxl:576

See also