On Thursday, 8 May 2014 at 14:34:27 UTC, H. S. Teoh via Digitalmars-d-learn wrote:
FWIW, for very long function signatures I write it this way:

        const(T)[] myVeryLongFunction(T)(const(T)[] arr,
                                         int        x,
                                         int        y,
                                         int        z,
                                         ExtraArgs  extraArgs)
                pure @safe nothrow
                if (is(T : int) &&
                    someOtherLongCriteria!T &&
                    yetMoreVeryLongCriteria!T)
        {
                ...
        }

I like this one with only exception that I prefer to keep parameter list to fill the line and always match brackets:

const(T)[] myVeryLongFunction(T)(const(T)[] arr,
    int x, int y, int z, ExtraArgs  extraArgs
)
    pure @safe nothrow
    if (is(T : int) &&
        someOtherLongCriteria!T &&
        yetMoreVeryLongCriteria!T
    )
{
}

for quick overview of parameters DDOC fits better IMHO

Reply via email to