DMD 0.177 release
Sean Kelly
sean at f4.ca
Fri Dec 15 11:03:20 PST 2006
Andrei Alexandrescu (See Website For Email) wrote:
> Kevin Bealer wrote:
>
>> I kind of hate to say it, but given all this, how far am I from
>> describing a C++
>> "&" type? Is there anything the C++ type does that isn't in the
>> above list?
>> (Other than the new proposal for '& &' references I guess, which seems
>> unnecessary
>> for D.)
>
> There are a few differences that make all the difference :o). One is
> that C++ is too eager to convert rvalues to const &, which has caused an
> unbounded amount of harm. Second, in C++, T& is a type indeed, but it's
> a half-life type, a pariah. So it would be probably wise to do the
> entire lvalue/rvalue distinction without making references into types.
> For example, outside function declarations, there should be no other
> place where inout can be used.
Agreed. In my time using D, the only time I've wished for a reference
type is for function return values. The language doesn't need a general
reference qualifier. Besides, we've already got inout parameter types,
and it seems completely reasonable that one should be able to pass
references out of a function as well as into a function.
Sean
More information about the Digitalmars-d-announce
mailing list