YesOrNo: useful idiom helper or wanking?

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Apr 11 10:13:32 PDT 2011


On 4/11/11, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
> template YesOrNo(string name)
> {
>      mixin("enum "~name~" : bool { no, yes }");
> }
>
> void someFunction(YesOrNo!"SomeOption") { }

How exactly would this work? I can't compile it.


More information about the Digitalmars-d mailing list