# std.bounded_array: fix \`self\` parameter type in \`constSlice\` · gitcafe/zig

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

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

Visibility: public

Requested revision: a83fb9289fe82a0e4f5c228342e79d559af69bc3

Requested commit: a83fb9289fe82a0e4f5c228342e79d559af69bc3

Commit: a83fb9289fe82a0e4f5c228342e79d559af69bc3

Tree: 71b4c0c745d107421cc60a23431292a175d4c1e9

Author: Rohlem

Committer: Andrew Kelley

## Message

```
std.bounded_array: fix `self` parameter type in `constSlice`

Because `.buffer` is an inline array field, we actually require `self` to be passed as a pointer.
If the compiler decided to pass the object by copying, we would return a pointer to to-be-destroyed stack memory.

```

## Parents

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

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