# std: add type-erased reader; base GenericReader on it · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/d8540dd7084b225566e67d60dafe0566309a8d51)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: d8540dd7084b225566e67d60dafe0566309a8d51

Requested commit: d8540dd7084b225566e67d60dafe0566309a8d51

Commit: d8540dd7084b225566e67d60dafe0566309a8d51

Tree: 6387dfdf54474d525a062d44aac86baf6e6f587a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std: add type-erased reader; base GenericReader on it

The idea here is to avoid code bloat by having only one actual io.Reader
implementation, which is type erased, and then implement a GenericReader
that preserves type information on top of that as thin glue code.

The strategy here is for that glue code to `@errSetCast` the result of
the type-erased reader functions, however, while trying to do that I
ran into #17343.

```

## Parents

- [4df7f7c86a0a105b5d3764121f259a39487a6c8a](https://git.cafe/gitcafe/zig/commit/4df7f7c86a0a105b5d3764121f259a39487a6c8a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/d8540dd7084b225566e67d60dafe0566309a8d51?format=markdown)
