File tree Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Expand file tree Collapse file tree 1 file changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -205,14 +205,6 @@ struct DList(T)
205
205
this ._payload = move(_payload);
206
206
}
207
207
208
- this (U)(BaseNode _base, U _payload) if (is (U == const (T)) ^ is (U == immutable (T)))
209
- {
210
- import std.algorithm.mutation : move;
211
-
212
- this ._base = _base;
213
- this ._payload = move(cast (T)_payload);
214
- }
215
-
216
208
inout (BaseNode)* asBaseNode () inout @trusted
217
209
{
218
210
return &_base;
@@ -1164,12 +1156,17 @@ private:
1164
1156
@safe unittest
1165
1157
{
1166
1158
import std.algorithm.comparison : equal;
1167
- DList! int D;
1168
1159
1169
- D.insert(1 );
1170
- assert (D[].equal([1 ]));
1160
+ struct A
1161
+ {
1162
+ int c;
1163
+ }
1171
1164
1172
- const c = 3 ;
1173
- D.insert(c);
1174
- assert (D[].equal([1 , 3 ]));
1165
+ DList! A B;
1166
+ B.insert(A(1 ));
1167
+ assert (B[].equal([A(1 )]));
1168
+
1169
+ const a = A(3 );
1170
+ B.insert(a);
1171
+ assert (B[].equal([A(1 ), A(3 )]));
1175
1172
}
You can’t perform that action at this time.
0 commit comments