annotate test/typeinfo4.d @ 91:3f949c6e2e9d trunk

[svn r95] added support for mains like: T main(string[] args) fixed a bug with slicing a pointer that is an argument with no storage
author lindquist
date Wed, 07 Nov 2007 04:52:56 +0100
parents 2c3cd3596187
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
58
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
1 module typeinfo4;
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
2
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
3 void main()
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
4 {
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
5 auto ti = typeid(void*);
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
6 assert(ti.toString() == "void*");
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
7 assert(ti.tsize() == size_t.sizeof);
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
8 void* a = null;
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
9 void* b = a + 1;
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
10 assert(ti.compare(&a,&b) < 0);
2c3cd3596187 [svn r62] Added support for TypeInfo _Array, _Function, _Pointer, _Delegate, _Enum
lindquist
parents:
diff changeset
11 }