Results for “iterator”
Small, practical examples. Search by task or narrow things down below.
Read values until a condition changes
Read values until a condition changes in a complete Rust program using the standard library.
Rust✓ Tested
Transform each value with map
Transform each value with map in a complete Rust program using the standard library.
Rust✓ Tested
Consume an asynchronous sequence
JavaScript: for await waits for each value of an async iterator in sequence.
JavaScript✓ Tested
Consume an asynchronous sequence
TypeScript: for await waits for each value of an async iterator in sequence.
TypeScript✓ Tested
Extract all regex matches with their groups
JavaScript: matchAll requires a global regular expression and returns an iterator of matches.
JavaScript✓ Tested
Extract all regex matches with their groups
TypeScript: matchAll requires a global regular expression and returns an iterator of matches.
TypeScript✓ Tested
Find both extremes in one algorithm call
C++: Check for a nonempty input before dereferencing the returned iterators.
C++✓ Tested
Find the first value satisfying a condition
C++: Compare the returned iterator with end before dereferencing it.
C++✓ Tested
Iterate over all regular-expression matches
C++: A regex iterator yields successive matches without manually updating an offset.
C++✓ Tested
Rotate a sequence around a selected position
C++: rotate places the element at the middle iterator first while preserving the two segment orders.
C++✓ Tested
Transform a vector into a separate result
C++: Pre-size the output before writing through its iterator.
C++✓ Tested