This one is not good either because it does not include TypeInfo, etc...
__traits(classInstanceSize, T)) is better choice, as Ali said... :)
:)
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... :)
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
.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
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) {
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
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. :)