DIP-1000 and return

Nordlöw via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jan 1 10:03:43 PST 2017


On Sunday, 1 January 2017 at 18:00:54 UTC, Stefan Koch wrote:
> Try:
>  auto asStatic(T, size_t length)(scope T[length] arr)
>  {
>      return arr;
>  }

Fails as

array_ex.d(72,10): Error: parameter arr is 'return' but function 
does not return any indirections
array_ex.d(80,27): Error: template instance 
array_ex.asStatic!(int, 3LU) error instantiating
array_ex.d(81,9): Error: static assert  (is(typeof(x) == 
int[x.length])) is false



More information about the Digitalmars-d-learn mailing list