dmd.dstruct - D Programming Language
Description: D Programming Language
Keywords: D programming language

Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Downloads
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Calendar
  - Forums
  - IRC
  - Community Discord
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Contributors
  - Foundation
  - Security Team
  - Donate
  - Sponsors
- Resources
  - Tour
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - run.dlang.io
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

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

# dmd.dstruct

Struct and union declarations.

Specification Structs, Unions

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.

Copyright © 1999-2020 by the D Language Foundation | Page generated by Ddoc on Tue Jul 7 12:26:03 2020