DIP1000: Scoped Pointers

rikki cattermole via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Wed Aug 10 23:36:58 PDT 2016


On 11/08/2016 5:41 PM, Walter Bright wrote:
> 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 :-)

Perfect :)



More information about the Digitalmars-d-announce mailing list