Report a bug
If you spot a problem with this page, click here to create a GitHub issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page.
Requires a signed-in GitHub account. This works well for small changes.
If you'd like to make larger changes you may want to consider using
a local clone.
mir.annotated
Annotated value
License:
Authors:
Ilya Yaroshenko
- struct
Annotated
(T); - A convenience definition of an annotated value.A structure that behaves like a recursive algebraic type should define enum _serdeRecursiveAlgebraic; member.Examples:
auto annotations = ["annotation"]; static struct S {double x;} auto as = Annotated!S(annotations, 5); assert(as.annotations == annotations); assert(as.value.x == 5); static struct C {double x;} auto ac = Annotated!S(annotations, 5); assert(ac.annotations == annotations); assert(ac.value.x == 5);
Examples:import mir.algebraic; auto annotations = ["annotation"]; static struct S {double x;} auto as = Annotated!(Variant!S)(annotations, 5); assert(as.annotations == annotations); assert(as.value.x == 5); static struct C {double x;} auto ac = Annotated!(Variant!S)(annotations, 5); assert(ac.annotations == annotations); assert(ac.value.x == 5);
- string[]
annotations
; - inout @property ref inout(T)
value
(); - @property ref T
value
(Tvalue
); - const bool
opEquals
(const Annotatedrhs
); - pure @safe this(Args...)(string[]
annotations
, Argsargs
); - Parameters:
string[] annotations
non-empty array of annotations Args args
arguments to construct value with
Copyright © 2016-2022 by Ilya Yaroshenko | Page generated by
Ddoc on Tue Jan 11 06:37:06 2022