|
@@ -30,7 +30,7 @@ package haxe.ds;
|
|
|
Other code holding a reference to the underlying `Array` can still modify it,
|
|
|
and the reference can be obtained with a `cast`.
|
|
|
**/
|
|
|
-@:forward(concat, copy, filter, indexOf, iterator, keyValueIterator, join, lastIndexOf, map, slice, contains, toString)
|
|
|
+@:forward(copy, filter, indexOf, iterator, keyValueIterator, join, lastIndexOf, map, slice, contains, toString)
|
|
|
abstract ReadOnlyArray<T>(Array<T>) from Array<T> to Iterable<T> {
|
|
|
/**
|
|
|
The length of `this` Array.
|
|
@@ -42,4 +42,21 @@ abstract ReadOnlyArray<T>(Array<T>) from Array<T> to Iterable<T> {
|
|
|
|
|
|
@:arrayAccess inline function get(i:Int)
|
|
|
return this[i];
|
|
|
+
|
|
|
+ /**
|
|
|
+ Returns a new Array by appending the elements of `a` to the elements of
|
|
|
+ `this` Array.
|
|
|
+
|
|
|
+ This operation does not modify `this` Array.
|
|
|
+
|
|
|
+ If `a` is the empty Array `[]`, a copy of `this` Array is returned.
|
|
|
+
|
|
|
+ The length of the returned Array is equal to the sum of `this.length`
|
|
|
+ and `a.length`.
|
|
|
+
|
|
|
+ If `a` is `null`, the result is unspecified.
|
|
|
+ **/
|
|
|
+ public inline function concat(a:ReadOnlyArray<T>):Array<T> {
|
|
|
+ return this.concat(cast a);
|
|
|
+ }
|
|
|
}
|