escaping addresses of ref parameters - not

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Feb 10 20:07:01 PST 2009


Brad Roberts wrote:
> Andrei Alexandrescu wrote:
>> You shouldn't do that anyway as structs can be moved freely.
>>
>> Andrei
> 
> Where does the language spec state or suggest that?  A subset of structs
> can be (those that contain no internal pointers nor have had their
> address taken (including references), but it's not a generally true
> fact, as far as I recall.

We plan to do that for D2. It would avoid all issues with C++'s copy
construction and rvalue references.

Structs with internal pointers will be allowed in D2 only if manipulated
exclusively through pointers.


Andrei



More information about the Digitalmars-d mailing list