On Tuesday, 9 February 2016 at 03:49:11 UTC, Enjoys Math wrote:
This:   
        double b = 1.0;

        Variant[string] aa = ["b": &b];

        writeln(aa["b"]);

fails with:

Error: cannot implicitly convert expression(["b":&b]) of type double*[string] to VariantN!20u[string]

Helps please!

Use an intermediate to carry the result of &<stuff>:

double b = 1.0;
Variant vb = &b;
Variant[string] aa = ["b": vb];
writeln(aa["b"]);

&b is a rvalue.
vb is a lvalue.

Reply via email to