opApply compilation woes

anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jul 12 10:33:49 PDT 2015


On Sunday, 12 July 2015 at 17:25:17 UTC, Gary Willoughby wrote:
> Why does the following code fail to compile if the 
> `writeln(value);` line is present?

The error message (formatted to be a little more readable):
----
Error: function test2.__unittestL6_1.Foo.opApply
   (int delegate(ref string) nothrow dg)
is not callable using argument types
   (int delegate(ref string __applyArg0) @system)
----

Note that the parameter has "nothrow", but the argument doesn't. 
And that's it: writeln isn't nothrow.


More information about the Digitalmars-d-learn mailing list