Code behaves incorrectly if it is compiled in std.functional

via Digitalmars-d digitalmars-d at puremagic.com
Fri Jun 5 04:53:29 PDT 2015


On Friday, 5 June 2015 at 10:54:36 UTC, ketmar wrote:
> On Fri, 05 Jun 2015 09:44:09 +0000, Marc Schütz wrote:
>
>> On Friday, 5 June 2015 at 04:39:28 UTC, ketmar wrote:
>>> On Fri, 05 Jun 2015 03:56:05 +0000, anonymous wrote:
>>>
>>>> On Friday, 5 June 2015 at 03:45:18 UTC, ketmar wrote:
>>>>> `auto int a`?! it shouldn't be accepted at all!
>>>> 
>>>> Yeah, but it's the same with "auto ref".
>>>
>>> `auto ref` has a well-defined meaning. yet `auto int` is 
>>> nonsence. it's
>>> definitely a compiler bug. ;-)
>> 
>> I don't think so. `auto` is a valid storage class like `const`,
>> `immutable` and `shared`.
>
> `auto` is not a storage class, but a `type placeholder`. at 
> least this is
> what i've been told by W or A (sorry, i can't remember the 
> link; i think
> it was somewhere in NG... or in bugzilla...). there is one 
> exception to
> this rule, though: `auto ref`.

My understanding is that `auto` is just C legacy, and originally 
had the same meaning as in C. But apparently the language has 
moved away from that over time.


More information about the Digitalmars-d mailing list