W3cubDocs

/D

dmd.dstruct

Compiler implementation of the D programming language.

Authors:
Walter Bright
License:
Boost License 1.0
Source
dstruct.d
Documentation
https://dlang.org/phobos/dmd_dstruct.html
Coverage
https://codecov.io/gh/dlang/dmd/src/master/src/dmd/dstruct.d
FuncDeclaration search_toString(StructDeclaration sd);

Search sd for a member function of the form: extern (D) string toString();

Parameters:
StructDeclaration sd struct declaration to search
Returns:
FuncDeclaration of toString() if found, null if not
void semanticTypeInfo(Scope* sc, Type t);

Request additional semantic analysis for TypeInfo generation.

Parameters:
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 bool fit(ref const Loc loc, Scope* sc, Expressions* elements, Type stype);

Fit elements[] to the corresponding types of the struct's fields.

Parameters:
Loc loc location to use for error messages
Scope* sc context
Expressions* elements explicit arguments used to construct object
Type stype the constructed object type.
Returns:
false if any errors occur, otherwise true and elements[] are rewritten for the output.
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.
Returns:
true if struct is POD
class UnionDeclaration: dmd.dstruct.StructDeclaration;

Unions are a variation on structs.

© 1999–2019 The D Language Foundation
Licensed under the Boost License 1.0.
https://dlang.org/phobos/dmd_dstruct.html