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

Implement array operations, such asa[] = b[] + c[].

SpecificationArray Operations

Authors:
Walter Bright
License:
Boost License 1.0

Sourcearrayop.d

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

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

boolisArrayOpValid(Expressione);
Check that there are no uses of arrays without [].
ExpressionarrayOp(BinExpe, Scope*sc);

ExpressionarrayOp(BinAssignExpe, Scope*sc);
Construct the array operation expression, call object.arrayOp!(tiargs)(args).
Encode operand types and operations into tiargs using reverse polish notation (RPN) to preserve precedence. Unary operations are prefixed with "u" (e.g. "u~"). Pass operand values (slices or scalars) as args.
Scalar expression sub-trees ofe are evaluated before calling into druntime to hoist them out of the loop. This is a valid evaluation order as the actual array operations have no side-effect.

Referenceshttps://github.com/dlang/dmd/blob/cdfadf8a18f474e6a1b8352af2541efe3e3467cc/druntime/src/object.d#L4694https://github.com/dlang/dmd/blob/master/druntime/src/core/internal/array/operations.d

boolisArrayOpImplicitCast(TypeDArraytfrom, TypeDArraytto);
Some implicit casting can be performed by the arrayOp template.
Parameters:
TypeDArraytfromtype converting from
TypeDArrayttotype converting to
Returns:
true if can be performed by arrayOp
@safe boolisUnaArrayOp(EXPop);
Test if expression is a unary array op.
@safe boolisBinArrayOp(EXPop);
Test if expression is a binary array op.
@safe boolisBinAssignArrayOp(EXPop);
Test if expression is a binary assignment array op.
boolisArrayOpOperand(Expressione);
Test if operand is a valid array op operand.
ErrorExparrayOpInvalidError(Expressione);
Print error message about invalid array operation.
Parameters:
Expressioneexpression with the invalid array operation
Returns:
instance of ErrorExp
Copyright © 1999-2026 by theD Language Foundation | Page generated byDdoc on Fri Feb 20 06:40:40 2026

[8]ページ先頭

©2009-2026 Movatter.jp