On Thursday, 11 October 2018 at 06:30:01 UTC, bauss wrote:
To give the real world example.

I'm converting a function into a soap envelope which means the identifiers must be the same because the parameter names passed in the soap envelope must have the same names.

Basically what I wanted was something like:

SoapEnvelope toEnvelope(alias fun)(...); // where ... is the parameters of fun

The toEnvelope function then constructs the envelope based on the function name and the parameters.

Within the "fun" function the soap envelope is constructed at compile-time and then simply sends the envelope to the soap client.

SoapEnvelope toEnvelope(alias fun)(Parameters!fun args)
{
    SoapEnvelope envelope;
    static foreach (i, name; ParameterIdentifierTuple!fun)
    {
        envelope.addField(name, args[i].toString());
    }
}

Reply via email to