Variants array and IDK

Robert Jacques sandford at jhu.edu
Mon Jan 31 19:27:39 PST 2011


On Mon, 31 Jan 2011 02:04:11 -0500, g g <g at g.com> wrote:

> IDK where to put this.
>
> first thing:
> Could it be a way to collapse Variants in std.variant?, like
> Variant x = Variant(1)
> Variant y = Variant([x,x,x,x])
> //y could be simplified to Variant(int[]) instead of  
> Variant(Variant(int)[])
> //now it is not implemented (as far i know)

// Although this has to be true
assert( y.type == typeid(Variant[]) );
// Should coerce support such lowering/conversions/collapses? i.e.
int[] z = y.coerce!(int[])();


More information about the Digitalmars-d mailing list