Optional out parameter of function

Joseph Rushton Wakeling joseph.wakeling at webdrake.net
Wed Nov 27 01:30:34 PST 2013


On 26/11/13 16:44, bearophile wrote:
> If you want a single function, dropping out you can write:
>
> int foo(size_t N)(in int i, int[N] j...)
> if (N < 2) {
>      static if (N == 1)
>          j[0] = i;
>      return i;
> }

That's a nice thought ... !  Thank you. :-)


More information about the Digitalmars-d-learn mailing list