shared Variant[string]

Fyodor Ustinov via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Jan 28 02:16:01 PST 2015


Hi!

Simple program:
import std.variant;

shared Variant[string] t;

void main() {
     t["t"] = "bebebe";
}

Without "shared" this program compiles and works.

With shared I get:

aa.d(6): Error: template 
std.variant.VariantN!32LU.VariantN.opAssign cannot deduce 
function from argument types !()(string) shared, candidates are:
/usr/include/dmd/phobos/std/variant.d(577):        
std.variant.VariantN!32LU.VariantN.opAssign(T)(T rhs)
aa.d(6): Error: cannot implicitly convert expression (VariantN(& 
handler, cast(ubyte)0u, ).this("bebebe")) of type VariantN!32LU 
to shared(VariantN!32LU)

Help me, please.


More information about the Digitalmars-d-learn mailing list