Initializing static array with contents of (static and dynamic) arrays
Rene Zwanenburg via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Jul 5 07:39:06 PDT 2016
On Tuesday, 5 July 2016 at 12:34:20 UTC, Johannes Loher wrote:
> I tried this, but it does not work correctly with slices.
The length of a slice is a runtime value, which is why it can't
be used to set static array size. What were you trying to
achieve? Avoid copying the input arrays, or accepting any slice?
In case of the first, you can put ref in front of the Args:
auto combineArrays(Args...)(ref Args args)
The second case will be a bit harder to solve nicely..
More information about the Digitalmars-d-learn
mailing list