So far, this reduces to:

template ParameterTypeTuple(func)
{
    static if (is(func Fptr : Fptr*) && is(Fptr P == function))
        alias P ParameterTypeTuple;
    else
        static assert(0, "argument has no parameters");
}

extern(Windows) alias void function() fpw_t;

extern(Windows) alias void function(fpw_t fp) cb_t;

struct DllImport(TFunction) {

//extern(Windows)
  static void bar(ParameterTypeTuple!(cb_t) args) {
      pragma (msg, "TFunction1: " ~ typeof(args[0]).stringof);
  }
}

extern(Windows)
alias DllImport!(cb_t) InternetSetStatusCallback;


void test()
{
    extern(Windows) static void foo() { }

    InternetSetStatusCallback.bar(&foo);
}


On 12/12/2011 2:16 AM, Richard Webb wrote:

I tried building Juno with the latest beta, and got a build failure related to ParameterTypeTuple and function type parameters.

Seems to be related to this: In 2.056, the code

_______________________________________________
dmd-beta mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/dmd-beta

Reply via email to