File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2646,6 +2646,9 @@ if (!is(Unqual!T == bool))
26462646 private alias RefCounted! (Payload, RefCountedAutoInitialize.no) Data;
26472647 private Data _data;
26482648
2649+ /**
2650+ Constructor taking a number of items
2651+ */
26492652 this (U)(U[] values ... ) if (isImplicitlyConvertible! (U, T))
26502653 {
26512654 auto p = cast (T* ) malloc(T.sizeof * values .length);
@@ -2661,6 +2664,16 @@ if (!is(Unqual!T == bool))
26612664 _data = Data(p[0 .. values .length]);
26622665 }
26632666
2667+ /**
2668+ Constructor taking an input range
2669+ */
2670+ this (Stuff)(Stuff stuff)
2671+ if (isInputRange! Stuff && isImplicitlyConvertible! (ElementType! Stuff, T) && ! is (Stuff == T[]))
2672+ {
2673+ insertBack(stuff);
2674+ }
2675+
2676+
26642677/**
26652678Comparison for equality.
26662679 */
@@ -3692,6 +3705,11 @@ unittest //11459
36923705 alias B = Array! (shared bool );
36933706}
36943707
3708+ unittest // 11884
3709+ {
3710+ auto a = Array! int ([1 , 2 , 2 ].filter! " true" ());
3711+ }
3712+
36953713// BinaryHeap
36963714/**
36973715Implements a $(WEB en.wikipedia.org/wiki/Binary_heap, binary heap)
You can’t perform that action at this time.
0 commit comments