Skip to content

Implement @bitSizeOf #4202

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

Merged
merged 1 commit into from
Jan 16, 2020
Merged

Implement @bitSizeOf #4202

merged 1 commit into from
Jan 16, 2020

Conversation

Vexu
Copy link
Member

@Vexu Vexu commented Jan 16, 2020

Closes #2177

@andrewrk andrewrk merged commit df03fcf into ziglang:master Jan 16, 2020
@Vexu Vexu deleted the bitsizeof branch January 16, 2020 18:15
@data-man
Copy link
Contributor

test "@bitSizeOf vector" {
    var v: @Vector(4, u31) = undefined;
    expect(@bitSizeOf(@Vector(4, u8)) == 4 * 8);
    expect(@bitSizeOf(@TypeOf(v)) == 4 * 31);
    expect(@bitSizeOf(@TypeOf(v[0])) == 31);
}

Nice! :)

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.

add @bitSizeOf
3 participants