RFC: moving forward with @nogc Phobos

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Mon Sep 29 15:16:13 PDT 2014


On 9/29/14, 3:11 PM, Freddy wrote:
>>
> Internally we should have something like:
>
> ---
> template String(MemoryManagementPolicy mmp=gc){
>       /++ ... +/
> }
> auto setExtension(MemoryManagementPolicy mmp = gc, R1, R2)(R1
> path, R2 ext)
> if (...)
> {
>       auto result=String!mmp();
>       /++ +/
> }
> ----
>
> or maybe even allowing user types in the template argument(the
> original purpose of templates)
>
> ---
> auto setExtension(String = string, R1, R2)(R1
> path, R2){
>       /++ +/
> }

That's correct. -- Andrei


More information about the Digitalmars-d mailing list