Movatterモバイル変換


[0]ホーム

URL:


D Logo
Menu
Search

Library Reference

version 2.112.0

overview

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 usinga local clone.

dmd.init

Defines initializers of variables, e.g. the array literal inint[3] x = [0, 1, 2].
Authors:
Walter Bright
License:
Boost License 1.0

Sourceinit.d

Documentationhttps://dlang.org/phobos/dmd_init.html

Coveragehttps://codecov.io/gh/dlang/dmd/src/master/compiler/src/dmd/init.d

classInitializer:dmd.ast_node.ASTNode;
boolsemanticDone;
initializerSemantic has been run on this
classVoidInitializer:dmd.init.Initializer;
classDefaultInitializer:dmd.init.Initializer;
The C23 default initializer{ }
classErrorInitializer:dmd.init.Initializer;
classStructInitializer:dmd.init.Initializer;
classArrayInitializer:dmd.init.Initializer;
classExpInitializer:dmd.init.Initializer;
structDesignator;
Holds thedesignator for C initializers
Expressionexp;
[ constant-expression ]
Identifierident;
. identifier
structDesigInit;
Holds thedesignation (opt) initializer for C initializers
Designators*designatorList;
designation (opt)
Initializerinitializer;
initializer
classCInitializer:dmd.init.Initializer;
C11 6.7.9 Initialization Represents the C initializer-list
DesigInitsinitializerList;
initializer-list
Typetype;
type that array will be used to initialize
InitializersyntaxCopy(Initializerinx);
Copy the AST for Initializer.
Parameters:
InitializerinxInitializer AST to copy
Returns:
the copy
ResultVisitInitializer(Result)(Initializerinit);
Visit each Initializer in init. Call a function visit%s(init) for each node, where %s is the op of the node. Otherwise call visitDefault(init) for that node. If the visit function returns R.init, continue visiting each node, otherwise return the value of R.
Parameters:
Resultreturn type
InitializerinitInitializer tree to traverse
Returns:
Result.init for continue, value of type Result for early exit
pure @safe stringvisitCase(stringhandler);
CTFE-only helper function for VisitInitializer.
Parameters:
stringhandlerstring for the name of the visit handler
Returns:
boilerplate code for a case
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Fri Feb 20 17:56:30 2026

[8]ページ先頭

©2009-2026 Movatter.jp