View source code
Display the source code in std/traits.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.
Alias std.traits.hasElaborateMove
True if S
or any type embedded directly in the representation of S
defines elaborate move semantics. Elaborate move semantics are
introduced by defining opPostMove(ref typeof(this))
for a struct
.
alias hasElaborateMove(S)
= hasElabMove!S;
Classes and unions never have elaborate move semantics.
Example
static assert(!hasElaborateMove!int);
static struct S1 { }
static struct S2 { void opPostMove(ref S2) {} }
static struct S3 { void opPostMove(inout ref S3) inout {} }
static struct S4 { void opPostMove(const ref S4) {} }
static struct S5 { void opPostMove(S5) {} }
static struct S6 { void opPostMove(int) {} }
static struct S7 { S3[1] field; }
static struct S8 { S3[] field; }
static struct S9 { S3[0] field; }
static struct S10 { @disable this(); S3 field; }
static assert(!hasElaborateMove!S1);
static assert( hasElaborateMove!S2);
static assert( hasElaborateMove!S3);
static assert( hasElaborateMove!(immutable S3));
static assert( hasElaborateMove!S4);
static assert(!hasElaborateMove!S5);
static assert(!hasElaborateMove!S6);
static assert( hasElaborateMove!S7);
static assert(!hasElaborateMove!S8);
static assert(!hasElaborateMove!S9);
static assert( hasElaborateMove!S10);
Authors
Walter Bright,
Tomasz Stachowiak (isExpressions
),
Andrei Alexandrescu,
Shin Fujishiro,
Robert Clipsham,
David Nadlinger,
Kenji Hara,
Shoichi Kato
License
Copyright © 1999-2024 by the D Language Foundation | Page generated by ddox.