constrainOnce

Returns a wrapper sequence that provides values of this sequence, but ensures it can be iterated only one time.

The operation is intermediate and stateless.

IllegalStateException is thrown on iterating the returned sequence for the second time and the following times.

Since Kotlin

1.1

Returns a wrapper sequence that provides values of this sequence, but ensures it can be iterated only one time.

The operation is intermediate and stateless.

IllegalStateException is thrown on iterating the returned sequence for the second time and the following times.

Since Kotlin

1.0