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.aggregate
Defines a Dsymbol representing an aggregate, which is a struct, union or class.
Specification Structs, Unions, Class.
Authors: 
License: 
Source aggregate.d
Documentation https://dlang.org/phobos/dmd_aggregate.html
- enumClassKind: ubyte;
- The ClassKind enum is used in AggregateDeclaration AST nodes to specify the linkage type of the struct/class/interface or if it is an anonymous class. If the class is anonymous it is also considered to be a D class.- d
- the aggregate is a d(efault) class
- cpp
- the aggregate is a C++ struct/class/interface
- objc
- the aggregate is an Objective-C class/interface
- c
- the aggregate is a C struct
 
- @safe const(char)*ClassKindToChars(ClassKindc);
- Give a nice string for a class kind for error messagesParameters:ClassKind cclass kind Returns:0-terminated string forc
- structMangleOverride;
- If an aggregate has a pargma(mangle, ...) this holds the information to mangle.
- abstract classAggregateDeclaration: dmd.dsymbol.ScopeDsymbol;
- Abstract aggregate as a common ancestor for Class- and StructDeclaration.- Typetype;
- STCstorage_class;
- uintstructsize;
- size of struct
- uintalignsize;
- size of struct for alignment purposes
- VarDeclarationsfields;
- VarDeclaration fields including flattened AnonDeclaration members
- Dsymboldeferred;
- any deferred semantic2() or semantic3() symbol
- ClassKindclassKind;
- specifies whether this is a D, C++, Objective-C or anonymous struct/class/interface
- CPPMANGLEcppmangle;
- Specify whether to mangle the aggregate as a class or a struct This information is used by the MSVC mangler Only valid for class and struct. TODO: Merge with ClassKind ?
- MangleOverride*pMangleOverride;
- overridden symbol with pragma(mangle, "...") if not null
- Dsymbolenclosing;
- !=null if is nested pointing to the dsymbol that directly enclosing it.- The function that enclosing it (nested struct and class)
- The class that enclosing it (nested class only)
- If enclosing aggregate is template, its enclosing dsymbol.
 See AggregateDeclaraton::makeNested for the details.
- VarDeclarationvthis;
- 'this' parameter if this aggregate is nested
- VarDeclarationvthis2;
- 'this' parameter if this aggregate is a template and is nested
- FuncDeclarationsinvs;
- Array of invariants
- FuncDeclarationinv;
- Merged invariant calling all members of invs
- Dsymbolctor;
- CtorDeclaration or TemplateDeclaration
- CtorDeclarationdefaultCtor;
- default constructor - should have no arguments, because it would be stored in TypeInfo_Class.defaultConstructor
- AliasThisaliasthis;
- forward unresolved lookups to aliasthis
- DtorDeclarationsuserDtors;
- user-defined destructors (~this()) - mixins can yield multiple ones
- DtorDeclarationaggrDtor;
- aggregate destructor calling userDtors and fieldDtor (and base class aggregate dtor for C++ classes)
- DtorDeclarationdtor;
- the aggregate destructor exposed as __xdtor alias
- DtorDeclarationtidtor;
- (same as aggrDtor, except for C++ classes with virtual dtor on Windows)aggregate destructor used in TypeInfo (must have extern(D) ABI)
- DtorDeclarationfieldDtor;
- function destructing (non-inherited) fields
- ExpressiongetRTInfo;
- pointer to GC info generated by object.RTInfo(this)
- Visibilityvisibility;
- boolnoDefaultCtor;
- no default construction
- booldisableNew;
- disallow allocations using new
- Sizeoksizeok;
- set when structsize contains valid data
- Scope*newScope(Scope*sc);
- Create a new scope from sc. semantic, semantic2 and semantic3 will use this for aggregate members.
- final size_tnonHiddenFields();
- Returns:The total number of fields minus the number of hidden fields.
- final boolcheckOverlappedFields();
- Calculate field[i].overlapped and overlapUnsafe, and check that all of explicit field initializers have unique memory space on instance.Returns:true if any errors happen.
- final voidsetDeprecated();
- Flag this aggregate as deprecated
- final boolisNested() const;
- Returns true if there's an extra member which is the 'this' pointer to the enclosing context (enclosing aggregate or function)
- final DsymbolsearchCtor();
- Look for constructor declaration.
- void*sinit;
- initializer symbol
 
- intapply(Dsymbolsymbol, int function(Dsymbol, void*)fp, void*ctx);
- Iterate this dsymbol or members of this scoped dsymbol, then callfpwith the found symbol and params.Parameters:Dsymbol symbolthe dsymbol or parent of members to call fp on int function(Dsymbol, void*) fpfunction pointer to process the iterated symbol. If it returns nonzero, the iteration will be aborted. void* ctxcontext parameter passed to fp. Returns:nonzero if the iteration is aborted by the return value of fp, or 0 if it's completed.
- pure nothrow @safe uintalignmember(structalign_talignment, uintmemalignsize, uintoffset);
- Do byte or word alignment as necessary. Align sizes of 0, as we may not know array sizes yet.Parameters:structalign_t alignmentstruct alignment that is in effect uint memalignsizenatural alignment of field uint offsetoffset to be aligned Returns:aligned offset
- nothrow @trusted uintplaceField(Locloc, ref uintnextoffset, uintmemsize, uintmemalignsize, structalign_talignment, ref uintaggsize, ref uintaggalignsize, boolisunion);
- Place a field (mem) into an aggregate (agg), which can be a struct, union or classParameters:Loc locsource location for error messages uint nextoffsetlocation just past the end of the previous field in the aggregate. Updated to be just past the end of this field to be placed, i.e. the future nextoffset uint memsizesize of field uint memalignsizenatural alignment of field structalign_t alignmentalignment in effect for this field uint aggsizesize of aggregate (updated) uint aggalignsizealignment of aggregate (updated) bool isunionthe aggregate is a union Returns:aligned offset to place field at
Copyright © 1999-2025 by the D Language Foundation | Page generated by
Ddoc on Fri Oct 10 22:07:44 2025