DConf 2013 Day 1 Talk 2 (Copy and Move Semantics)
Walter Bright
newshound2 at digitalmars.com
Sun May 12 13:28:56 PDT 2013
On 5/12/2013 6:01 AM, Andrei Alexandrescu wrote:
> Bartosz, Walter and I reached a similar design a few years ago. We just thought
> it complicates things too much for what it does.
I've been working in the background on a scheme that can infer uniqueness. The
beauty of it is it will not require visible language changes - it's just that
things that didn't compile before now will. It won't solve all the problems, but
I'm hoping it'll solve enough that the rest will not be more than a minor annoyance.
For a trivial example,
shared p = new int;
would work, as 'new int' would be inferred to be unique, and a unique pointer
can be implicitly cast to immutable or shared. This plays to D's strength with
function purity, transitive const/immutable/shared, attribute inference, etc.
More information about the Digitalmars-d
mailing list