On 11/23/16 3:05 PM, Ilya Yaroshenko wrote:
On Wednesday, 23 November 2016 at 19:51:50 UTC, Andrei Alexandrescu wrote:
On 11/23/16 2:40 PM, Ilya Yaroshenko wrote:
On Wednesday, 23 November 2016 at 19:16:29 UTC, Andrei Alexandrescu
wrote:
A tip for the range adaptor: have it allocate and own the generator
internally. That way it's easy to make it reference counted
economically.
Current adaptor should be used in a function scope. (Would be great to
have a DIP for that kind of semantic check). An RC adaptor can be added
too. First we need to find a real world use case where we need to store
a random range outside of a function. -- Ilya
Yah, problem here is we can't make that @safe. -- Andrei
Can we improve D to make it safe?
It's difficult in the general case for objective reasons (modular
analysis). For this, we may be able to take an argument by ref, save its
address inside, add some scope attributes. It's a project. -- Andrei