Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions std/algorithm.d
Original file line number Diff line number Diff line change
Expand Up @@ -1133,17 +1133,17 @@ void initializeAll(Range)(Range range)
if (isForwardRange!Range && is(typeof(range.front = range.front)))
{
alias ElementType!Range T;
static assert(is(typeof(&(range.front()))) || !hasElaborateAssign!T,
static assert(is(typeof(&(range.front))) || !hasElaborateAssign!T,
"Cannot initialize a range that does not expose"
" references to its elements");
static if (!isDynamicArray!Range)
{
static if (is(typeof(&(range.front()))))
static if (is(typeof(&(range.front))))
{
// Range exposes references
for (; !range.empty; range.popFront())
{
memcpy(&(range.front()), &T.init, T.sizeof);
memcpy(&(range.front), &T.init, T.sizeof);
}
}
else
Expand Down
2 changes: 1 addition & 1 deletion std/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ unittest
/++
Returns whether the given file (or directory) exists.
+/
@property bool exists(in char[] name)
bool exists(in char[] name)
{
version(Windows)
{
Expand Down
10 changes: 4 additions & 6 deletions std/range.d
Original file line number Diff line number Diff line change
Expand Up @@ -1784,8 +1784,7 @@ unittest
assert(s1[1..5].length == 4);
assert(s1[0..0].empty);
assert(s1[3..3].empty);
// assert(s1[$ .. $].empty);
assert(s1[s1.opDollar() .. s1.opDollar()].empty);
assert(s1[$ .. $].empty);

auto s2 = stride(arr, 2);
assert(equal(s2[0..2], [1,3]));
Expand All @@ -1794,8 +1793,7 @@ unittest
assert(s2[1..5].length == 4);
assert(s2[0..0].empty);
assert(s2[3..3].empty);
// assert(s2[$ .. $].empty);
assert(s2[s2.opDollar() .. s2.opDollar()].empty);
assert(s2[$ .. $].empty);

// Test fix for Bug 5035
auto m = [1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4]; // 3 rows, 4 columns
Expand Down Expand Up @@ -6377,7 +6375,7 @@ ElementType!R moveFront(R)(R r)
return r.moveFront();
} else static if (!hasElaborateCopyConstructor!(ElementType!R)) {
return r.front;
} else static if (is(typeof(&(r.front())) == ElementType!R*)) {
} else static if (is(typeof(&(r.front)) == ElementType!R*)) {
return move(r.front);
} else {
static assert(0,
Expand Down Expand Up @@ -6409,7 +6407,7 @@ ElementType!R moveBack(R)(R r)
return r.moveBack();
} else static if (!hasElaborateCopyConstructor!(ElementType!R)) {
return r.back;
} else static if (is(typeof(&(r.back())) == ElementType!R*)) {
} else static if (is(typeof(&(r.back)) == ElementType!R*)) {
return move(r.back);
} else {
static assert(0,
Expand Down