RFC: moving forward with @nogc Phobos

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


On 9/29/14, 5:06 AM, Vladimir Panteleev wrote:
> On Monday, 29 September 2014 at 10:49:53 UTC, Andrei Alexandrescu wrote:
>> auto setExtension(MemoryManagementPolicy mmp = gc, R1, R2)(R1 path, R2
>> ext)
>> if (...)
>> {
>>     static if (mmp == gc) alias S = string;
>>     else alias S = RCString;
>>     S result;
>>     ...
>>     return result;
>> }
>
> Is this practically feasible without blowing up Phobos several times in
> size and complexity?

I believe so. For the most part implementations will be identical - just 
look at the RCString primitives, which are virtually the same as string's.

> And I'm not sure adding a template parameter to every function is going
> to work well, what with all the existing template parameters -
> especially the optional ones.

Not all functions, just those that allocate. I agree there will be a few 
decisions to be made there.


Andrei



More information about the Digitalmars-d mailing list