Re: Variant and immutable struct

2016-08-21 Thread Øivind via Digitalmars-d-learn
On Sunday, 10 January 2016 at 17:50:44 UTC, Vlad Leberstein wrote: As I'm not very good at D, I would like to get some feedback about this solutions' viability. AFAIU memcpy-ing struct here is safe because all target arguments ever passed to tryPutting are internal to implementation(and SHOUL

Re: Variant and immutable struct

2016-01-10 Thread Vlad Leberstein via Digitalmars-d-learn
Okay, I've cleared up some misconception. On Wednesday, 6 January 2016 at 03:22:47 UTC, Vlad Leberstein wrote: The same happens with immutable class(there is related thread with workaround at http://www.digitalmars.com/d/archives/digitalmars/D/learn/Sending_an_immutable_object_to_a_thread_7386

Variant and immutable struct

2016-01-05 Thread Vlad Leberstein via Digitalmars-d-learn
Hi! I've stumbled into some strange problem. I'm trying to put an immutable struct into std.variant.Variant but get some compilation error(but only when struct has at least one member). Stripped down example(tested on Linux dmd64 v2.069.2): import std.variant : Variant; immutable struct Te