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.

Classes and unions never have elaborate move semantics.

template hasElaborateMove (
S
) {}

Examples

1 static assert(!hasElaborateMove!int);
2 
3 static struct S1 { }
4 static struct S2 { void opPostMove(ref S2) {} }
5 static struct S3 { void opPostMove(inout ref S3) inout {} }
6 static struct S4 { void opPostMove(const ref S4) {} }
7 static struct S5 { void opPostMove(S5) {} }
8 static struct S6 { void opPostMove(int) {} }
9 static struct S7 { S3[1] field; }
10 static struct S8 { S3[] field; }
11 static struct S9 { S3[0] field; }
12 static struct S10 { @disable this(); S3 field; }
13 static assert(!hasElaborateMove!S1);
14 static assert( hasElaborateMove!S2);
15 static assert( hasElaborateMove!S3);
16 static assert( hasElaborateMove!(immutable S3));
17 static assert( hasElaborateMove!S4);
18 static assert(!hasElaborateMove!S5);
19 static assert(!hasElaborateMove!S6);
20 static assert( hasElaborateMove!S7);
21 static assert(!hasElaborateMove!S8);
22 static assert(!hasElaborateMove!S9);
23 static assert( hasElaborateMove!S10);

Meta

Suggestion Box / Bug Report