Disable GC entirely

Jacob Carlborg doob at me.com
Mon Apr 8 02:41:05 PDT 2013


On 2013-04-08 11:17, Dicebot wrote:

> b) You are forced to make function templated to mark it as @nogc. Bad.

It depends on how it's used. If it's enough to annotate a type the 
function doesn't need to be templated. This should work just fine:


class Foo { }

struct ThreadSafe (T)
{
     T t;
}

ThreadSafe!(Foo) foo;

void process (ThreadSafe!(Foo) foo) { /* process foo */ }

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list