Skip to content
Merged
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
13 changes: 11 additions & 2 deletions std/container/array.d
Original file line number Diff line number Diff line change
Expand Up @@ -1928,11 +1928,11 @@ if (is(Unqual!T == bool))
// Fits within the current array
if (stuff)
{
data[$ - 1] |= (1u << rem);
data[$ - 1] |= (cast(size_t)1 << rem);
}
else
{
data[$ - 1] &= ~(1u << rem);
data[$ - 1] &= ~(cast(size_t)1 << rem);
}
}
else
Expand All @@ -1959,6 +1959,15 @@ if (is(Unqual!T == bool))
/// ditto
alias stableInsertBack = insertBack;

unittest
{
Array!bool a;
for (int i = 0; i < 100; ++i)
a.insertBack(true);
foreach (e; a)
assert(e);
}

/**
Removes the value at the front or back of the container. The
stable version behaves the same, but guarantees that ranges
Expand Down