Re: variant .init value

2019-02-07 Thread bauss via Digitalmars-d-learn
On Thursday, 7 February 2019 at 07:33:50 UTC, Norm wrote: Hi, I'm trying to use Variant in a struct and want a default init value like so: --- struct S { Variant v = Variant(10); } void main() {auto s = S();} but when I try to build this I get the following error: dmd2/linux/bin64/../../s

Re: variant .init value

2019-02-07 Thread Norm via Digitalmars-d-learn
On Thursday, 7 February 2019 at 07:44:17 UTC, Alex wrote: On Thursday, 7 February 2019 at 07:33:50 UTC, Norm wrote: [...] Hmm... found something similar from 2014... https://issues.dlang.org/show_bug.cgi?id=11864 Thanks, I've added a comment to that bug report. Cheers, Norm

Re: variant .init value

2019-02-06 Thread Alex via Digitalmars-d-learn
On Thursday, 7 February 2019 at 07:33:50 UTC, Norm wrote: Hi, I'm trying to use Variant in a struct and want a default init value like so: --- struct S { Variant v = Variant(10); } void main() {auto s = S();} but when I try to build this I get the following error: dmd2/linux/bin64/../../s

variant .init value

2019-02-06 Thread Norm via Digitalmars-d-learn
Hi, I'm trying to use Variant in a struct and want a default init value like so: --- struct S { Variant v = Variant(10); } void main() {auto s = S();} but when I try to build this I get the following error: dmd2/linux/bin64/../../src/phobos/std/variant.d(661): Error: memcpy cannot be inte