The code should work. I submitted a fix a while ago that allows Variant to hold types of any size (internally it uses pointers and dynamic allocation).

Did you submit this to bugzilla?

Andrei

On 6/18/10 20:45 PDT, Sean Kelly wrote:
More compact:

     import std.variant;
     import std.typecons;

     struct Val
     {
         Variant v;
         Object  o;
     }

     void main()
     {
         alias Tuple!(Val) Wrap;
         Wrap    wrap;
         Variant data;
         Val     val;

         wrap.field[0] = val;
         data = wrap;
     }

I think it's simply a bug with the static checking in the opAssign for Variant. 
 It should reject the value as too large, but instead it accepts it and 
explodes.  When I pass a Val* the code compiles fine.
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos
_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to