let

template let(alias fun)
ref
T
let
(
T
)
(
auto ref T obj
)

Members

Functions

let
T let(T obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Examples

struct Test
{
    string name;
    int age;
}

auto test = Test().let!((ref test) => test.name = "A");
assert(test.name == "A");
struct Test
{
    string name;
    int age;
}

auto test = Test().let!((ref test) => test.age = 10);
assert(test.age == 10);
struct Test
{
    string name;
    int age;
}

auto test = Test().let!((ref test) { test.name = "TEST"; test.age = 10; });
assert(test.name == "TEST");
assert(test.age == 10);

Meta