Encapsulate return value in scoped

Yuxuan Shui via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jun 18 17:25:11 PDT 2015


On Friday, 19 June 2015 at 00:00:50 UTC, Ali Çehreli wrote:
> On 06/18/2015 04:53 PM, Yuxuan Shui wrote:
>
> > On Thursday, 11 June 2015 at 21:38:59 UTC, Ali Çehreli wrote:
>
> >> About returning scoped!C, I think it works:
>
> > I just find out that the document of scoped says that "It's
>
> Thanks for fixing the typo there. (The documentations has lower 
> case: "it's". ;) )
>
> > illegal to
> > move a class instance
>
> Wait! You fixed that as well? :) The doc that I am looking at 
> says "class reference":
>
>   http://dlang.org/phobos/std_typecons.html#.scoped

Those are fixed by: 
https://github.com/D-Programming-Language/phobos/pull/3016

>
> > even if you are sure there are no pointers to it.
> > As such, it is illegal to move a scoped object."
> >
> > So this is not a solution?
>
> I guess not. :-/
>
> Ali

I don't understand. What problem can moving a scoped cause when 
there's no reference to its inner class?


More information about the Digitalmars-d-learn mailing list