Re: Fields size property

2011-11-22 Thread Dejan Lekic
This one is not good either because it does not include TypeInfo, etc... __traits(classInstanceSize, T)) is better choice, as Ali said... :)

Re: Fields size property

2011-11-22 Thread Andrej Mitrovic
:) On 11/22/11, Dejan Lekic dejan.le...@gmail.com wrote: This one is not good either because it does not include TypeInfo, etc... __traits(classInstanceSize, T)) is better choice, as Ali said... :)

Re: Fields size property

2011-11-18 Thread Dejan Lekic
Andrej Mitrovic wrote: .sizeof on a struct works nicely since it's a POD, but this can't work on classes since it just returns the pointer size. I don't know whether this is useful all that much, but I'm curious how large my classes are. Anyway, since I couldn't find anything in Phobos

Fields size property

2011-11-10 Thread Andrej Mitrovic
.sizeof on a struct works nicely since it's a POD, but this can't work on classes since it just returns the pointer size. I don't know whether this is useful all that much, but I'm curious how large my classes are. Anyway, since I couldn't find anything in Phobos I've got this working: import

Re: Fields size property

2011-11-10 Thread Andrej Mitrovic
On 11/11/11, Andrej Mitrovic andrej.mitrov...@gmail.com wrote: foreach (type; RepresentationTypeTuple!Foo) { Way to screw that up. Fix: foreach (type; RepresentationTypeTuple!T) {

Re: Fields size property

2011-11-10 Thread Ali Çehreli
On 11/10/2011 05:44 PM, Andrej Mitrovic wrote: .sizeof on a struct works nicely since it's a POD, but this can't work on classes since it just returns the pointer size. I don't know whether this is useful all that much, but I'm curious how large my classes are. Anyway, since I couldn't find

Re: Fields size property

2011-11-10 Thread Andrej Mitrovic
On 11/11/11, Ali Çehreli acehr...@yahoo.com wrote: This is the standard way: __traits(classInstanceSize, Foo) Ali Thanks! It's also more reliable it seems. :)