DIP1000: Scoped Pointers
rikki cattermole via Digitalmars-d-announce
digitalmars-d-announce at puremagic.com
Wed Aug 10 22:05:23 PDT 2016
On 11/08/2016 8:35 AM, Dicebot wrote:
> The first DIP has just landed into the new queue. It is a proposal from
> language authors and thus it bypasses usual nitpicking process and
> proceeds straight to requesting community (your!) feedback.
>
> Essentially, it is an attempt to solve reference lifetime problem by
> extending implementation of `scope` keyword.
>
> Proposal text: https://github.com/dlang/DIPs/blob/master/DIPs/DIP1000.md
>
> Few notes:
>
> - Please submit pull requests to adjust the markdown document if you
> want to propose any improvements (mentioning @WalterBright and @andralex
> for confirmation).
> - The proposal refers to a number of other documents and it is
> recommended to become familiar at least briefly with all of them.
> - At this point the question I'd personally suggest to be evaluated is
> "does this proposal enable enough useful designs?". A good check would
> be to try taking some of your projects and see if having DIP1000
> approved and implemented could improve them.
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*)
If this does work, this is a major addition that I've been waiting for,
for my managed memory concept!
https://github.com/rikkimax/alphaPhobos/blob/master/source/std/experimental/memory/managed.d
After this I'll only need proper ref counting in the language ;)
More information about the Digitalmars-d-announce
mailing list