YesOrNo: useful idiom helper or wanking?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Apr 11 11:29:01 PDT 2011


On 4/11/11, KennyTM~ <kennytm at gmail.com> wrote:
> The idea, IIUC, is to avoid documenting that extra enum type. So, for
> example,
>
>      TRange topNCopy(alias less = "a < b", SRange, TRange)
>                     (SRange source, TRange target,
>                      YesOrNo!"SortOutput" sorted = false);
>
> and then we can call it as
>
>      topNCopy([1,3,5,2,4], result, SortOutput.yes);

But how do you make `SortOutput` known at the calling site?


More information about the Digitalmars-d mailing list