Appending static arrays
Nordlöw via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Mon Jul 17 13:03:30 PDT 2017
On Monday, 17 July 2017 at 18:54:31 UTC, Stefan Koch wrote:
> So all you need to do make it so
> auto cat(T[]...)(T args)
> {
> T[] result;
> mixin(() {
> string mix = `result = `;
> foreach(i;args.length)
> {
> mix ~= `args[` ~ itos(i) ~ `] ~`;
> }
> mix[$-1] = ';';
> return mix;
> }());
>
> return result;
> }
>
> that should do it :)
Thanks, but I wan't a @nogc-variant, which was posted below.
More information about the Digitalmars-d-learn
mailing list