view tests/mini/tuplestruct.d @ 1132:76e72fdef04d

Fix tuple declarations in aggregates.
author Christian Kamm <kamm incasoftware de>
date Mon, 23 Mar 2009 14:47:51 +0100
parents
children 8ebbad15fc99
line wrap: on
line source

struct V(T...) {
    T v;
}

alias V!(Object, int) MyV;

void main()
{
    assert(MyV.sizeof == Object.sizeof + int.sizeof);
    auto o = new Object;
    auto v = MyV(o, 3);
    assert(v.v[0] is o);
    assert(v.v[1] == 3);
}