Auto syntax revisited

Georg Wrede georg.wrede at nospam.org
Mon Feb 20 20:58:44 PST 2006


Mike Capp wrote:
> In article <dtdb2e$2lsp$1 at digitaldaemon.com>, Sean Kelly says...
> 
>> If we're moving towards stack-based auto classes then I'd prefer
>> the distinction be associated with the object and not the
>> reference.  ie.
>> 
>> auto foo = local Bar();
>> 
>> I think the distinction is important because foo can be reassigned
>> to a non-local object.
> 
> Not currently, it can't. From
> http://www.digitalmars.com/d/attribute.html#auto : "Assignment to an
> auto, other than initialization, is not allowed."

If 'local' were implemented, then it could, since then the meaning of 
'auto' would only mean auto-typing and not RAII.



More information about the Digitalmars-d mailing list