Thread overview
TypeInfo.tisize is zero. (bug?)
Mar 01, 2005
ahiru
Mar 01, 2005
ahiru
Mar 22, 2005
Thomas Kuehne
March 01, 2005
void main() {
// tsize is a member of class TypeInfo. (see also dmd/src/phobos/object.d)
assert(int.sizeof == typeid(int).tsize); // OK
assert(double.sizeof == typeid(double).tsize); // OK
alias void function() func;
assert(typeid(func).sizeof == typeid(func).tsize); // NG (typeid(func).tsize ==
0)
alias int delegate() del;
assert(typeid(del).sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)
}

There is not the harm particularly, but it is ...
May not tisize become always equal with sizeof?



---
ahiru >(' )


March 01, 2005
In article <d014bu$1rfe$1@digitaldaemon.com>, ahiru says...
>
>void main() {
>// tsize is a member of class TypeInfo. (see also dmd/src/phobos/object.d)
>assert(int.sizeof == typeid(int).tsize); // OK
>assert(double.sizeof == typeid(double).tsize); // OK
>alias void function() func;
>assert(typeid(func).sizeof == typeid(func).tsize); // NG (typeid(func).tsize ==
>0)
>alias int delegate() del;
>assert(typeid(del).sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)
>}

mistake...

alias void function() func;
assert(func.sizeof == typeid(func).tsize); // NG (typeid(func).tsize == 0)
alias int delegate() del;
assert(del.sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)


---
ahiru >(' )


March 22, 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ahiru schrieb am Tue, 1 Mar 2005 07:32:11 +0000 (UTC):
> In article <d014bu$1rfe$1@digitaldaemon.com>, ahiru says...
>>
>>void main() {
>>// tsize is a member of class TypeInfo. (see also dmd/src/phobos/object.d)
>>assert(int.sizeof == typeid(int).tsize); // OK
>>assert(double.sizeof == typeid(double).tsize); // OK
>>alias void function() func;
>>assert(typeid(func).sizeof == typeid(func).tsize); // NG (typeid(func).tsize ==
>>0)
>>alias int delegate() del;
>>assert(typeid(del).sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)
>>}
>
> mistake...
>
> alias void function() func;
> assert(func.sizeof == typeid(func).tsize); // NG (typeid(func).tsize == 0)
> alias int delegate() del;
> assert(del.sizeof == typeid(del).tsize); // NG (typeid(del).tsize == 0)

Added to DStress as http://dstress.kuehne.cn/run/typeid_84.d http://dstress.kuehne.cn/run/typeid_85.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFCP8/J3w+/yD4P9tIRAo7iAJ9NcjD7A5thuf9veJNCuiK9erKu4wCfZlLx
rdUoJdv8hCXzHt6djiz0VuA=
=74Nf
-----END PGP SIGNATURE-----