RFC: moving forward with @nogc Phobos

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 29 04:25:08 PDT 2014


On 9/29/14, 4:03 AM, Daniel Kozak via Digitalmars-d wrote:
> I would add something like this:
>
> @DefaultMemoryManagementPolicy(rc)
> module A;
>
> void main() {
>      auto p1 = setExtension("hello", ".txt"); // use rc
> }

(please don't overquote!)

Yah, I realized I forgot to mention this: if we play our cards right, a 
lot of code will build in both approaches to memory management by just 
flipping a switch. In particular, the switch can be defaulted to 
something else.

I was thinking of leaving it to the user:

module A;
immutable myMMP = rc;

void main() {
     auto p1 = setExtension!myMMP("hello", ".txt");
}


Andrei




More information about the Digitalmars-d mailing list