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
12 changes: 12 additions & 0 deletions std/container/dlist.d
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ Complexity: $(BIGOH n).
{
return DList(this[]);
}
alias save = dup;

/**
Returns a range that iterates over all elements of the container, in
Expand Down Expand Up @@ -515,6 +516,7 @@ Complexity: $(BIGOH 1).

/// ditto
alias stableRemoveFront = removeFront;
alias popFront = removeFront;

/// ditto
void removeBack()
Expand All @@ -526,6 +528,7 @@ Complexity: $(BIGOH 1).

/// ditto
alias stableRemoveBack = removeBack;
alias popBack = removeBack;

/**
Removes $(D howMany) values at the front or back of the
Expand Down Expand Up @@ -945,3 +948,12 @@ private:
a.insertFront(iota(0, 5)); // can insert range with non-ref front
assert(a.front == 0 && a.back == 4);
}

unittest
{
import std.range;
// should be an input, forward and bidirectional range
assert(isInputRange!(DList!int));
assert(isForwardRange!(DList!int));
assert(isBidirectionalRange!(DList!int));
}
10 changes: 10 additions & 0 deletions std/container/slist.d
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,7 @@ Complexity: $(BIGOH n).
{
return SList(this[]);
}
alias save = dup;

/**
Returns a range that iterates over all elements of the container, in
Expand Down Expand Up @@ -396,6 +397,7 @@ Complexity: $(BIGOH 1).

/// ditto
alias stableRemoveFront = removeFront;
alias popFront = removeFront;

/**
Removes $(D howMany) values at the front or back of the
Expand Down Expand Up @@ -819,3 +821,11 @@ unittest
s.reverse();
assert(s[].equal([3, 2, 1]));
}

unittest
{
import std.range;
// should be an input and forward range
assert(isInputRange!(SList!int));
assert(isForwardRange!(SList!int));
}