{
auto list = List!(int).build(1, 2, 3);
list.pushFront(42);
assert(list == [42, 1, 2, 3]);
}
{
auto list = List!(int).build(1, 2, 3);
list.pushFront(only(4, 5, 6));
assert(list == [6, 5, 4, 1, 2, 3]);
}
{
auto a = List!(int).build(1, 2, 3);
auto b = List!(int).build(4, 5, 6);
a.pushFront(b);
assert(a == [6, 5, 4, 1, 2, 3]);
}
{
List!(int) list = List!(int).build(1, 2, 3);
int[3] tmp = [4, 5, 6];
list.pushFront(tmp[]);
assert(list == [6, 5, 4, 1, 2, 3]);
}
{
struct Range{
int i;
bool empty()(){return i == 0;}
int front()(){return i;}
void popFront()(){i -= 1;}
//size_t length(); //no length
}
List!(int) list = List!(int).build(6, 5, 4);
list.pushFront(Range(3));
assert(list == [1, 2, 3, 6, 5, 4]);
}
Extends the List by appending additional elements at the end of list.