mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 03:53:20 +00:00
langref: separate header for faulty default field values
This commit is contained in:
parent
e084c46ed6
commit
37df6ba86e
@ -2138,6 +2138,7 @@ or
|
|||||||
</p>
|
</p>
|
||||||
{#code|struct_default_field_values.zig#}
|
{#code|struct_default_field_values.zig#}
|
||||||
|
|
||||||
|
{#header_open|Faulty Default Field Values#}
|
||||||
<p>
|
<p>
|
||||||
Default field values are only appropriate when the data invariants of a struct
|
Default field values are only appropriate when the data invariants of a struct
|
||||||
cannot be violated by omitting that field from an initialization.
|
cannot be violated by omitting that field from an initialization.
|
||||||
@ -2162,6 +2163,7 @@ or
|
|||||||
without violating data invariants, then use an initialization method that accepts
|
without violating data invariants, then use an initialization method that accepts
|
||||||
those runtime values, and populates the remaining fields.</p>
|
those runtime values, and populates the remaining fields.</p>
|
||||||
{#header_close#}
|
{#header_close#}
|
||||||
|
{#header_close#}
|
||||||
|
|
||||||
{#header_open|extern struct#}
|
{#header_open|extern struct#}
|
||||||
<p>An {#syntax#}extern struct{#endsyntax#} has in-memory layout matching
|
<p>An {#syntax#}extern struct{#endsyntax#} has in-memory layout matching
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user