Skip to content

Commit 8ec19b0

Browse files
Make test case stronger and remove useless contructor overload
1 parent cba26e4 commit 8ec19b0

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

std/container/dlist.d

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,6 @@ struct DList(T)
205205
this._payload = move(_payload);
206206
}
207207

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-
216208
inout(BaseNode)* asBaseNode() inout @trusted
217209
{
218210
return &_base;
@@ -1164,12 +1156,17 @@ private:
11641156
@safe unittest
11651157
{
11661158
import std.algorithm.comparison : equal;
1167-
DList!int D;
11681159

1169-
D.insert(1);
1170-
assert(D[].equal([1]));
1160+
struct A
1161+
{
1162+
int c;
1163+
}
11711164

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)]));
11751172
}

0 commit comments

Comments
 (0)