diff options
Diffstat (limited to 'source/std.elna')
| -rw-r--r-- | source/std.elna | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/std.elna b/source/std.elna index 31160a3..c028b93 100644 --- a/source/std.elna +++ b/source/std.elna @@ -5,5 +5,18 @@ module type StdString* = []const Word8 + StdOptional#[T]* = record + has_value: Bool; + value: ^T + end + +(* + Constructs an optional holding the pointer value. + + @param value Initial optional value. + @return Constructed optional. +*) +proc std_optional_make#[T]*(value: ^T) -> StdOptional#[T] +return { StdOptional#[T]; has_value: true, value: value } end. |
