----
import std.stdio;

void foo1(void function(void*) fp) { }
void foo2(void function(int) fp) { }
void foo3(void*) { }

void main()
{
        foo1((void* ptr) => ( assert(ptr is null) ));
foo2((int a) => ( a + 1 )); /// Fails: Error: function foo2 (void function(int) fp) is not callable using argument types (int function(int a) pure nothrow @safe)
        
        foo1(&foo3);
        
        void foo4(void function(void*) fp) { }
foo1(&foo4); /// Fails: Error: function foo1 (void function(void*) fp) is not callable using argument types (void delegate(void function(void*) fp))
}
----
Can someone explain that to me?

Reply via email to