Skip to content

Commit

Permalink
Add missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
9rnsr committed Jun 28, 2014
1 parent 19fa794 commit fa8c4f3
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions std/container/binaryheap.d
Expand Up @@ -36,6 +36,8 @@ container.
struct BinaryHeap(Store, alias less = "a < b")
if (isRandomAccessRange!(Store) || isRandomAccessRange!(typeof(Store.init[])))
{
import std.functional : binaryFun;

// Really weird @@BUG@@: if you comment out the "private:" label below,
// std.algorithm can't unittest anymore
//private:
Expand Down
16 changes: 16 additions & 0 deletions std/container/dlist.d
Expand Up @@ -378,6 +378,8 @@ Complexity: $(BIGOH 1).
*/
T removeAny()
{
import std.algorithm : move;

assert(!empty, "DList.removeAny: List is empty");
auto result = move(back);
removeBack();
Expand Down Expand Up @@ -584,6 +586,8 @@ private:

unittest
{
import std.algorithm : equal;

//Tests construction signatures
alias IntList = DList!int;
auto a0 = IntList();
Expand All @@ -601,6 +605,8 @@ unittest

unittest
{
import std.algorithm : equal;

alias IntList = DList!int;
IntList list = IntList([0,1,2,3]);
assert(equal(list[],[0,1,2,3]));
Expand All @@ -616,6 +622,8 @@ unittest

unittest
{
import std.algorithm : equal;

alias IntList = DList!int;
IntList list = IntList([0,1,2,3]);
auto range = list[];
Expand Down Expand Up @@ -672,6 +680,8 @@ unittest

unittest
{
import std.algorithm : equal;

auto dl = DList!string(["a", "b", "d"]);
dl.insertAfter(dl[], "e"); // insert at the end
assert(equal(dl[], ["a", "b", "d", "e"]));
Expand All @@ -683,6 +693,8 @@ unittest

unittest
{
import std.algorithm : equal;

auto dl = DList!string(["a", "b", "d"]);
dl.insertBefore(dl[], "e"); // insert at the front
assert(equal(dl[], ["e", "a", "b", "d"]));
Expand Down Expand Up @@ -735,6 +747,8 @@ unittest

unittest
{
import std.algorithm : equal;

//Verify all flavors of ~
auto a = DList!int();
auto b = DList!int();
Expand Down Expand Up @@ -769,6 +783,8 @@ unittest

unittest
{
import std.algorithm : equal;

//8905
auto a = DList!int([1, 2, 3, 4]);
auto r = a[];
Expand Down
4 changes: 4 additions & 0 deletions std/container/rbtree.d
@@ -1,6 +1,8 @@
module std.container.rbtree;

import std.exception, std.algorithm, std.range, std.traits;
import std.functional : binaryFun;
import std.typetuple : allSatisfy;
public import std.container.util;

version(unittest) version = RBDoChecks;
Expand Down Expand Up @@ -685,6 +687,8 @@ final class RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false)
}
else
{
import std.typecons : Tuple;

if(added)
{
++_length;
Expand Down
10 changes: 10 additions & 0 deletions std/container/slist.d
Expand Up @@ -126,6 +126,8 @@ Defines the container's primary range, which embodies a forward range.

T moveFront()
{
import std.algorithm : move;

assert(!empty, "SList.Range.moveFront: Range is empty");
return move(_head._payload);
}
Expand Down Expand Up @@ -284,6 +286,8 @@ Complexity: $(BIGOH 1).
*/
T removeAny()
{
import std.algorithm : move;

assert(!empty, "SList.removeAny: List is empty");
auto result = move(_root._payload);
_root = _root._next;
Expand Down Expand Up @@ -533,6 +537,8 @@ unittest

unittest
{
import std.algorithm : equal;

auto s = SList!int(1, 2, 3);
s.removeFront();
assert(equal(s[], [2, 3]));
Expand Down Expand Up @@ -564,6 +570,8 @@ unittest

unittest
{
import std.algorithm;

// insertAfter documentation example
auto sl = SList!string(["a", "b", "d"]);
sl.insertAfter(sl[], "e"); // insert at the end (slowest)
Expand All @@ -584,6 +592,8 @@ unittest

unittest
{
import std.algorithm : equal;

auto s = SList!int(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
auto r = s[];
popFrontN(r, 3);
Expand Down

0 comments on commit fa8c4f3

Please sign in to comment.