Support iterators returning lent T (#11938)

* lent iterators
* rebase tests
* update changelog
* fix comments, more tests
This commit is contained in:
cooldome 2019-08-31 18:23:54 +01:00 • committed by Andreas Rumpf
commit 2b565aad89
7 changed files with 116 additions and 27 deletions

View file

@ -61,6 +61,11 @@ type
## Language additions
- Inline iterators returning `lent T` types are now supported, similarly to iterators returning `var T`:
```nim
iterator myitems[T](x: openarray[T]): lent T
iterator mypairs[T](x: openarray[T]): tuple[idx: int, val: lent T]
```
## Language changes