YesOrNo: useful idiom helper or wanking?

Dmitry Olshansky dmitry.olsh at gmail.com
Mon Apr 11 11:09:08 PDT 2011


On 11.04.2011 21:13, Andrej Mitrovic wrote:
> 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.
Yeah it's problematic, making it eponymous make function definition 
work, but at the calling site the party ends...

-- 
Dmitry Olshansky



More information about the Digitalmars-d mailing list