If T[new] is the container for T[], then what is the container for T[U]?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Apr 25 16:11:57 PDT 2009


Robert Jacques wrote:
> On Sat, 25 Apr 2009 18:04:32 -0400, Andrei Alexandrescu 
> <SeeWebsiteForEmail at erdani.org> wrote:
> Also, I see a major logical problem with your proposal:
> Given     A single owner is required for deterministic destruction.
> Then      The array's owner is responsible for the deterministic 
> destruction.
> Therefore When the array's owner goes out of scope, it must destruct the 
> array.
> But Then  How does a function return an array?

My understanding is that you don't know how C++ and D value semantics 
work. It would be impossible to answer your (albeit good) question 
without first writing a tutorial on the topic, which unfortunately I 
don't have the time for.


Andrei



More information about the Digitalmars-d mailing list