proposal for general dup function

Dan dbdavidson at yahoo.com
Mon Dec 10 14:49:43 PST 2012


On Monday, 10 December 2012 at 21:24:09 UTC, Andrei Alexandrescu 
wrote:
> On 12/10/12 4:20 PM, Jacob Carlborg wrote:
>> On 2012-12-10 21:10, Andrei Alexandrescu wrote:
>>
>>> You want to create a new window with the same parent. At the 
>>> top level
>>> there's one desktop window, and probably having two would be 
>>> odd.
>>
>> There are many applications that support several top level 
>> windows.
>> These are mostly document based.
>
> Are we really up for continuing to debate this?
>
> Andrei

I'm not up for this debate about Windows - just the original 
about gdup :-)

It is not an attempt to automatically determine reference or 
value semantics, even though your ideas on @owned and @foreign 
make sense and are a fine use of attributes. It is about a single 
phobos/library [g]dup function for structs that provides 
recursive deep copy without the need for struct designer to do 
anything extra. I think the benefits pointed out in the original 
make sense and are worth pursuing.

I have a feeling Walter would disagree - simply because 
apparently he is not a fan of postblits, which serve similar 
purpose. Further, from another thread he is not a fan of deep 
copy semantics in general, as he said there is almost never a 
need (which I would love to hear more commentary on). Yet TDPL 
shows the a prime example for the need in 7.1.3 (Widget). Plus we 
get questions all the time on how to cross from the 
const/immutable world to the mutable - which gdup provides.

Thanks
Dan


More information about the Digitalmars-d mailing list