File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -78,12 +78,22 @@ struct Array(T)
7878 return this [_length- howMany.. _length];
7979 }
8080
81- void put (ref VoxAllocator allocator, T [] items... )
81+ void put (ref VoxAllocator allocator, const (T) [] items... )
8282 {
8383 if (_length + items.length > _capacity) extend(allocator, cast (uint )items.length);
8484
8585 _length += items.length;
86- this [_length- items.length.. $][] = items;
86+ this [_length- items.length.. $][] = cast (T[])items;
87+ }
88+
89+ static if (is (T == ubyte ))
90+ {
91+ void putAsBytes (V)(ref VoxAllocator allocator, auto ref V value)
92+ if (! is (immutable (V) == immutable (I)[], I))
93+ {
94+ ubyte [] ptr = voidPut(allocator, V.sizeof);
95+ ptr[] = * cast (ubyte [V.sizeof]* )&value;
96+ }
8797 }
8898
8999 void putFront (ref VoxAllocator allocator, T item)
You can’t perform that action at this time.
0 commit comments