atosed

Used to create function whith "Named" arguments

atosed
(
alias func
ARGS...
)
(
ARGS argv
)

Parameters

func

function/delegate which accept as param 1 struct

argv ARGS

arumments of new function

Examples

struct MyStruct
{
    int i;
    string s;
}

mixin MixinParameters!MyStruct;

auto str(MyStruct m)
{
    import std.conv : to;

    return m.to!string;
}

assert(atosed!str(I(42)) == str(MyStruct(42, "")));
assert(atosed!str(S("42"), I(42)) == str(MyStruct(42, "42")));

Meta