structs are now lvalues - what is with "auto ref"?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Mon Dec 24 10:42:32 PST 2012


On 12/24/12 1:05 PM, monarch_dodra wrote:
> On Monday, 24 December 2012 at 17:37:54 UTC, Andrei Alexandrescu wrote:
>> On 12/24/12 12:11 PM, Jonathan M Davis wrote:
>>> On Monday, December 24, 2012 17:55:23 Minas Mina wrote:
>>>> On Sunday, 23 December 2012 at 23:59:55 UTC, Jonathan M Davis
>>>>
>>>> wrote:
>>>>> On Monday, December 24, 2012 00:48:01 Namespace wrote:
>>>>> but Andrei is dead set against
>>>>>
>>>>> - Jonathan M Davis
>>>>
>>>> Why?
>>>
>>> He's convinced that it's caused problems for C++ and was a major
>>> mistake. You
>>> can search the newsgroup for discussions on it. The most recent one
>>> which
>>> involved Andrei was in the beta group:
>>>
>>> http://forum.dlang.org/post/4F84D6DD.5090405@digitalmars.com
>>>
>>> - Jonathan M Davis
>>
>> An important smoking gun is C++'s min(), which is allows writing
>> unsafe code without casts.
>>
>> const int& haveANiceDay = min(4, 5);
>>
>>
>> Andrei
>
> But that example actually works correctly.

No.

Andrei


More information about the Digitalmars-d-learn mailing list