Inconsistency with function pointers
David Nadlinger
see at klickverbot.at
Sat Aug 4 12:03:28 PDT 2012
On Saturday, 4 August 2012 at 15:23:39 UTC, Russel Winder wrote:
> trial.d(7): Error: constructor core.thread.Thread.this (void
> function()
> fn, ulong sz = cast(ulong)0) is not callable using argument
> types (void
> delegate() delegate() pure nothrow @safe)
> Failed: 'dmd' '-v' '-o-' 'trial.d' '-I.'
>
> So I cannot use an anonymous delegate where I can use a named
> delegate?
You are trying to pass a delegate which returns a delegate –
this isn't going to work. ;)
In your first example is that f is implicitly called due to the
non-strict property syntax.
David
More information about the Digitalmars-d-learn
mailing list