{
Vector!(int, 6) vec = null;
assert(vec.empty);
}
{
Vector!(int, 6) vec = Vector!(int, 6).build(1, 2);
assert(vec == [1, 2]);
}
{
auto tmp = Vector!(int, 6).build(1, 2);
Vector!(int, 6) vec = tmp;
assert(vec == [1, 2]);
}
{
Vector!(int, 6) vec = Vector!(int, 4).build(1, 2);
assert(vec == [1, 2]);
}
{
auto tmp = Vector!(int, 4).build(1, 2);
Vector!(int, 6) vec = tmp;
assert(vec == [1, 2]);
}
{
int[3] tmp = [1, 2, 3];
Vector!(int, 6) vec = tmp[];
assert(vec == [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
}
Vector!(int, 6) vec = Range(3);
assert(vec == [3, 2, 1]);
}
Constructs a Vector object from other vector.