[Issue 2716] Confusion of auto and scope as the class attribute

Sean Kelly sean at invisibleduck.org
Tue Mar 10 20:25:25 PDT 2009


d-bugmail at puremagic.com wrote:
> 
> But there's something wrong - auto is still given on attribute.html, but the
> way it's used there it doesn't seem to be an attribute.

'auto' was originally and continues to be a storage class.  It's the 
default storage class if another one isn't specified, so the following 
are equivalent:

auto int x = 5;
int x = 5;

Type inference happens via the omission of a type specifier, so auto is 
mostly used in this context, ie:

auto x = 5; // int variable with a storage class of 'auto'
const x = 5; // int variable with a storage class of 'const'


More information about the Digitalmars-d-bugs mailing list