YesOrNo: useful idiom helper or wanking?

bearophile bearophileHUGS at lycos.com
Mon Apr 11 12:26:30 PDT 2011


spir:

> True, but only for the case of yes/no; in this case only, the  bool type 
> provides proper *constants* which *meaning* is obvious. Else, you need an enum 
> anyway, even with named args.
>      f = File(path="f.txt", mode=2);

Right, in some cases I prefer an enum and in some cases a named argument.

Bye,
bearophile


More information about the Digitalmars-d mailing list