On Sunday, 12 September 2021 at 02:49:48 UTC, jfondren wrote:
On Sunday, 12 September 2021 at 02:44:36 UTC, Alex Bryan wrote:
`T[] dynArr` can be passed (by reference) to a function that
takes `ref T[] data` but `T[10] data` cannot? Why not?
```d
void add1(ref int[] nums) {
nums ~= 1;
}
u
On Sunday, 12 September 2021 at 02:44:36 UTC, Alex Bryan wrote:
`T[] dynArr` can be passed (by reference) to a function that
takes `ref T[] data` but `T[10] data` cannot? Why not?
```d
void add1(ref int[] nums) {
nums ~= 1;
}
unittest {
int[] nums;
nums.add1;
nums.add1;
num
On Sunday, 12 September 2021 at 01:48:07 UTC, H. S. Teoh wrote:
On Sun, Sep 12, 2021 at 01:08:17AM +, Alex Bryan via
Digitalmars-d-learn wrote:
I am having trouble discovering what the proper (or at least a
proper) way is to write a function that can take either a
static or dynamic array as
On Sun, Sep 12, 2021 at 01:08:17AM +, Alex Bryan via Digitalmars-d-learn
wrote:
> I am having trouble discovering what the proper (or at least a proper)
> way is to write a function that can take either a static or dynamic
> array as a parameter. My current implementation consists of 2
> overl
I am having trouble discovering what the proper (or at least a
proper) way is to write a function that can take either a static
or dynamic array as a parameter. My current implementation
consists of 2 overloaded functions (one takes a dynamic array,
the other takes a static array) with 99% copy