atos

Used for get struct from variadic arguments

T
atos
(
T
ARGS...
)
(
ARGS argv
)

Parameters

T

Type of struct

argv ARGS

fields of struct

Return Value

Type: T

struct of T type field by argv values;

Examples

struct MyStruct
{
    int i;
    float f = 0.0f;
    string s;
}

mixin MixinParameters!MyStruct;

assert(atos!MyStruct(I(42)) == MyStruct(42, 0, ""));
assert(atos!MyStruct(F(42)) == MyStruct(0, 42, ""));
assert(atos!MyStruct(S("42")) == MyStruct(0, 0, "42"));
assert(atos!MyStruct(S("42"), I(42)) == MyStruct(42, 0, "42"));
assert(atos!MyStruct(F(42), S("42"), I(42)) == MyStruct(42, 42, "42"));

Meta