Skip to content

Commit

Permalink
Merge pull request dlang#4091 from dcarp/issue15807
Browse files Browse the repository at this point in the history
Fix issue 15807

Signed-off-by: Martin Krejcirik <mk@krej.cz>
  • Loading branch information
schveiguy authored and tramker committed Sep 17, 2016
1 parent 738bd83 commit eb5b906
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions std/container/array.d
Expand Up @@ -1930,11 +1930,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 @@ -1961,6 +1961,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

0 comments on commit eb5b906

Please sign in to comment.