How can I do that in @nogc?

Namespace via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Feb 25 12:35:11 PST 2015


On Wednesday, 25 February 2015 at 19:53:16 UTC, Ivan Timokhin 
wrote:
> On Wed, Feb 25, 2015 at 07:32:48PM +0000, Namespace wrote:
>> ----
>> void glCheck(lazy void func, string file = __FILE__, uint line 
>> = __LINE__) {
>> 	func();
>> 	glCheckError(file, line);
>> }
>> ----
>> 
>> How can I specify that 'func' is @nogc? Or can define the 
>> function otherwise?
>
> Try
>
> void glCheck(scope void delegate() @nogc func,...)

That seems not to work:
----
Error: function test.glCheck (scope void delegate() @nogc func, 
...) is not callable using argument types (void)
----


More information about the Digitalmars-d-learn mailing list