[Rosettacode] D code line length limit

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu May 8 07:50:54 PDT 2014


H. S. Teoh:

> 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)
> 	{
> 		...
> 	}

You also need the pre&post-conditions :-)

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list