DConf 2013 Day 1 Talk 2 (Copy and Move Semantics)
deadalnix
deadalnix at gmail.com
Mon May 13 00:06:20 PDT 2013
On Sunday, 12 May 2013 at 20:28:56 UTC, Walter Bright wrote:
> 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.
It smell like an ad hoc solution that will be completely
undefined.
More information about the Digitalmars-d
mailing list