Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.


Struct and union declarations.

Specification Structs, Unions


Source dstruct.d

FuncDeclaration search_toString(StructDeclaration sd);
Search sd for a member function of the form: extern (D) string toString();
StructDeclaration sd struct declaration to search
FuncDeclaration of toString() if found, null if not
void semanticTypeInfo(Scope* sc, Type t);
Request additional semantic analysis for TypeInfo generation.
Scope* sc context
Type t type that TypeInfo is being generated for
class StructDeclaration: dmd.aggregate.AggregateDeclaration;
All struct declarations are an instance of this.
final void determineTypeProperties();
Compute cached type properties for TypeStruct
final bool isPOD();
Determine if struct is POD (Plain Old Data).
POD is defined as:
  1. not nested
  2. no postblits, destructors, or assignment operators
  3. no ref fields or fields that are themselves non-POD
The idea being these are compatible with C structs.
true if struct is POD
final bool hasCopyConstruction();
Determine if struct has copy construction (copy constructor or postblit)
true if struct has copy construction
final bool hasRegularCtor(bool checkDisabled = false);
Verifies whether the struct declaration has a constructor that is not a copy constructor. Optionally, it can check whether the struct declaration has a regular constructor, that is not disabled.
bool checkDisabled if the struct has a regular non-disabled constructor
true, if the struct has a regular (optionally, not disabled) constructor, false otherwise.
bool _isZeroInit(Expression exp);
Determine if exp is all binary zeros.
Expression exp expression to check
true if it's all binary 0
class UnionDeclaration: dmd.dstruct.StructDeclaration;
Unions are a variation on structs.