DIP1000: Scoped Pointers

Walter Bright via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Aug 10 22:41:22 PDT 2016


On 8/10/2016 10:05 PM, rikki cattermole wrote:
> Question:
> I see RefCountedSlice example, does this mean if I alias this say like:
>
> struct FooBar;
>
> struct Foo {
>     FooBar* v;
>
>     scope FooBar* get() { return v; }
>     alias this get;
> }
>
> That it will operate correctly in the below case?
>
> func(myFoo);
> void func(scope FooBar*)

Yes, it better :-)



More information about the Digitalmars-d-announce mailing list