# allow implicit cast from \`S\` to \`?&const S\` · gitcafe/zig

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

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

Visibility: public

Requested revision: f11b9480192dea44acb92cb9edd7a91c7c73cd2f

Requested commit: f11b9480192dea44acb92cb9edd7a91c7c73cd2f

Commit: f11b9480192dea44acb92cb9edd7a91c7c73cd2f

Tree: 5172a83b0a23842d661d4e2d8bf74587e902913d

Author: Ben Noordhuis

Committer: Ben Noordhuis

## Message

```
allow implicit cast from `S` to `?&const S`

Allow implicit casts from container types to nullable const pointers to
said container type.  That is:

    fn f() void {
        const s = S {};
        g(s);   // Works.
        g(&s);  // So does this.
    }

    fn g(_: ?&const S) void {  // Nullable const pointer.
    }

Fixes #731.

```

## Parents

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

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