On Sunday, 17 March 2013 at 22:11:27 UTC, Andrej Mitrovic wrote:
On 3/17/13, Artur Skawina <[email protected]> wrote:
That's because "auto ref" is a hack.
IOW "auto ref" != "auto" + "ref", just as "static if" !=
"static" + "if".
Both auto and auto ref are documented features, type inference
with
any storage class is not a documented feature.
Yes it is.
From the spec (http://dlang.org/declaration.html)
-- Implicit Type Inference --
If a declaration starts with a StorageClass and has a
NonVoidInitializer from which the type can be inferred, the type
on the declaration can be omitted.
The first example is even:
static x = 3;
Any storage class will do. No need for auto. It's not documented
as needed, it's not implied to be needed, and it isn't needed.