`auto` keyword origins
Adam D Ruppe
destructionator at gmail.com
Mon Jun 26 00:12:39 UTC 2023
On Monday, 26 June 2023 at 00:00:48 UTC, Alexander Tretyak wrote:
> I'm just curious when was the `auto` keyword introduced in D?
What's New for D 0.137
Oct 24, 2005
New/Changed Features
Added implicit type inference.
from: https://digitalmars.com/d/1.0/changelog1.html
Though the auto keyword was around earlier (it actually comes
from old C), and technically doesn't mean exactly what you think
it means - the `auto` keyword isn't what's magic, you can use
many others in its place (most the time) like `const` and
`immutable` among more - but the feature referred to is the type
inference.
> I always thought that `auto` in D was taken from C++. But what
> if it is opposite, i.e. C++11's `auto` was inspired by D's
> `auto`?
It probably went both ways. The C++ proposal you linked is
definitely earlier than D adopting the thing, and perhaps D's use
of it helped prompt the C++ committee to adopt it too.
More information about the Digitalmars-d
mailing list