Exactly Replicating a Function's Signature?

Andrej Mitrovic andrej.mitrovich at gmail.com
Wed Jan 19 07:29:22 PST 2011


Is this what you're looking for?:

import std.stdio;
import std.traits;

void test(alias F)()
{
    ReturnType!(F) otherFunc(ParameterTypeTuple!(F))
    {
        typeof(return) result;
        return result;
    }
}

double foo(int x, int y)
{
    double result;
    return x + y * 2.5;
}

void main()
{
    test!foo;
}


More information about the Digitalmars-d-learn mailing list