'auto' keyword

Adam D Ruppe destructionator at gmail.com
Sun Mar 12 13:27:05 UTC 2023


On Sunday, 12 March 2023 at 13:07:58 UTC, DLearner wrote:
> Is it correct that this _single_ keyword is used to indicate 
> _two_ quite different things:

No, it only actually does #2 in your thing. The type is optional 
meaning *any* storage class will work for type inference. `auto` 
is not special in variable declarations. (it can be special in 
other contexts though).

auto A = 5;
static A = 5;
const A = 5;

all the same.


More information about the Digitalmars-d-learn mailing list