View source code
Display the source code in dmd/sideeffect.d from which this page was generated on github.
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 local clone.
Build a temporary variable to extract e's evaluation, if e is not trivial.
Expression extractSideEffect (
.dscope .Scope* sc,
ref Expression e0,
bool alwaysCopy = false
|name||name for temporary variable|
|e0||a new side effect part will be appended to it.|
|alwaysCopy||if true, build new temporary variable even if e is trivial.|
When e is trivial and alwaysCopy == false, e itself is returned. Otherwise, a new VarExp is returned.
e's lvalue-ness will be handled well by STC.ref_ or STC.rvalue.
Copyright © 1999-2023 by the D Language Foundation | Page generated by ddox.