POD

Sean Kelly sean at f4.ca
Fri Dec 29 08:24:20 PST 2006


Aleksey S. Skidan wrote:
> == Quote from Hasan Aljudy (hasan.aljudy at gmail.com)'s article
>> Aleksey S. Skidan wrote:
>>> I just wonder if there's such a thing as POD type in D? I have failed to find
>>> one. The extern(C) struct seems not to be the thing because it is hardwired to
>>> the ABI.
>> Basic types and structs are POD (plain old data).
>> Unless you're referring to a different kind of POD.
> 
> Great thanks, but I do know what POD is. But unfortunately D's structs are not POD
> types. They depend on TypeInfo. For ex.:
> 
> module blah;
> struct Foo{ int a; }
> static Foo bar = { 3; };
> 
> Then
> $ dmd -c blah.d
> $ objdump -t blah.o
> 
> And you'll see a section named like .gnu.linkonce.d.*__initZ that contains the
> bar. But this section contains a reference to TypeInfo object for the Foo.

Sure, but the TypeInfo doesn't affect the size or layout of Foo.


Sean



More information about the Digitalmars-d mailing list