comparison tests/mini/tuplestruct.d @ 1135:8ebbad15fc99

Remove struct padding which was making this test fail on 64-bit systems.
author Frits van Bommel <fvbommel wxs.nl>
date Tue, 24 Mar 2009 03:14:22 +0100
parents 76e72fdef04d
children
comparison
equal deleted inserted replaced
1134:152bd2c804d0 1135:8ebbad15fc99
1 struct V(T...) { 1 struct V(T...) {
2 T v; 2 T v;
3 } 3 }
4 4
5 alias V!(Object, int) MyV; 5 alias V!(float, int) MyV;
6 6
7 void main() 7 void main()
8 { 8 {
9 assert(MyV.sizeof == Object.sizeof + int.sizeof); 9 assert(MyV.sizeof == float.sizeof + int.sizeof);
10 auto o = new Object; 10 auto f = 3.75f;
11 auto v = MyV(o, 3); 11 auto v = MyV(f, 3);
12 assert(v.v[0] is o); 12 assert(v.v[0] == 3.75f);
13 assert(v.v[1] == 3); 13 assert(v.v[1] == 3);
14 } 14 }
15 15