Skip to content

Section 3.1.1 confuses the size of a slice type with its length #205

@virinci

Description

@virinci

It mentions that the size of a string object with type []const u8 is not known at compile time. This is incorrect, as the size is 16-bytes, which is known at compile time. What's not known is the length, given by slice.len. Similarly, a struct containing a member of slice type also has its size known at compile time, unless some conflicting member is present (I don't know if Zig can have unsized types).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions