Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

infer orelse on a C-pointer as a C-pointer #2171

Merged
merged 1 commit into from
Feb 8, 2025

Conversation

nolanderc
Copy link
Contributor

A C-pointer [*c]T can be null, and it is possible to use with orelse and .? unwrapping.
However, as [*c] pointers carry some special semantics, the result is still a [*c] pointer.

@nolanderc
Copy link
Contributor Author

nolanderc commented Feb 6, 2025

Seems the build is failing due to a new Zig version, so this is blocked on #2168

Copy link
Member

@Techatrix Techatrix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL you can unwrap c pointers

@Techatrix Techatrix merged commit b733071 into zigtools:master Feb 8, 2025
6 checks passed
@nolanderc nolanderc deleted the c-ptr-orelse branch February 8, 2025 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants