StructDeclaration

extern (C++)
class StructDeclaration : AggregateDeclaration {
int zeroInit;
bool hasIdentityAssign;
bool hasIdentityEquals;
FuncDeclarations postblits;
FuncDeclaration postblit;
FuncDeclaration xeq;
FuncDeclaration xcmp;
FuncDeclaration xhash;
FuncDeclaration xerreq;
FuncDeclaration xerrcmp;
structalign_t alignment;
StructPOD ispod;
Type arg1type;
Type arg2type;
bool requestTypeInfo;
}

Members

Functions

fit
bool fit(Loc loc, Scope* sc, Expressions* elements, Type stype)

Fit elements[] to the corresponding type of field[]. Input: loc sc elements The explicit arguments that given to construct object. stype The constructed object type. Returns false if any errors occur. Otherwise, returns true and elements[] are rewritten for the output.

isPOD
bool isPOD()

Return true if struct is POD (Plain Old Data). This is defined as: not nested no postblits, destructors, or assignment operators no 'ref' fields or fields that are themselves non-POD The idea being these are compatible with C structs.

Inherited Members

From AggregateDeclaration

newScope
Scope* newScope(Scope* sc)

Create a new scope from sc. semantic, semantic2 and semantic3 will use this for aggregate members.

determineFields
bool determineFields()

Find all instance fields, then push them into fields.

determineSize
bool determineSize(Loc loc)

Collect all instance fields, then determine instance size.

checkOverlappedFields
bool checkOverlappedFields()

Calculate fieldi.overlapped and overlapUnsafe, and check that all of explicit field initializers have unique memory space on instance.

fill
bool fill(Loc loc, Expressions* elements, bool ctorinit)

Fill out remainder of elements[] with default initializers for fields[].

alignmember
void alignmember(structalign_t alignment, uint size, uint* poffset)

Do byte or word alignment as necessary. Align sizes of 0, as we may not know array sizes yet.

placeField
uint placeField(uint* nextoffset, uint memsize, uint memalignsize, structalign_t alignment, uint* paggsize, uint* paggalignsize, bool isunion)

Place a member (mem) into an aggregate (agg), which can be a struct, union or class

isNested
bool isNested()

Returns true if there's an extra member which is the 'this' pointer to the enclosing context (enclosing aggregate or function)

searchCtor
Dsymbol searchCtor()

Look for constructor declaration.

Meta