File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,14 +16,19 @@ pub fn Impl(comptime T: type, comptime Ifc: fn (type) type) type { ... }
1616The function ` Ifc ` must always return a struct type. If ` Unwrap(T) `
1717has a declaration matching the name of a field from
1818` Ifc(T) ` that cannot coerce to the type of the field, then a
19- compile error will occur[ ^ 1 ] .
19+ compile error will occur.
20+
21+ ### Unwrap
22+
23+ The internal ` Unwrap ` function removes all layers of ` * ` , ` ? ` , or ` ! `
24+ wrapping a type, e.g. ` Unwrap(!?*u32) ` is ` u32 ` .
2025
2126## Return value
2227
2328The type ` Impl(T, Ifc) ` is a struct type with the same fields
2429as ` Ifc(T) ` , but with the default value of each field set equal to
2530the declaration of ` Unwrap(T) ` of the same name, if such a declaration
26- exists[ ^ 1 ] .
31+ exists.
2732
2833## Example
2934
@@ -109,6 +114,3 @@ More in-depth [examples][4] are provided.
109114[ 2 ] : https://en.wikipedia.org/wiki/Static_dispatch
110115[ 3 ] : https://github.com/permutationlock/zimpl/blob/main/why.md
111116[ 4 ] : https://github.com/permutationlock/zimpl/blob/main/examples
112-
113- [ ^ 1 ] : The internal ` Unwrap ` function removes all layers of ` * ` , ` ? ` , or ` ! `
114- wrapping a type, e.g. ` Unwrap(!?*u32) ` is ` u32 ` .
You can’t perform that action at this time.
0 commit comments