inferred size for static array initialization

Basile B. via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue May 3 08:34:13 PDT 2016


On Monday, 2 May 2016 at 17:43:56 UTC, Namespace wrote:
>
> I still like
> ----
> auto s(T, size_t n)(T[n] arr) {
> 	return arr;
> }

Wooah, this trick is awesome. But actually it does the same thing 
that what I've proposed before. Exactly the same code is 
generated. So I'd say that it's rather a matter of readability.

https://godbolt.org/g/wGTs52
https://godbolt.org/g/cXECyO





More information about the Digitalmars-d-learn mailing list