POD

Aleksey S. Skidan al.skidan at gmail.com
Fri Dec 29 07:56:53 PST 2006


== 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.



More information about the Digitalmars-d mailing list