Flag proposal

KennyTM~ kennytm at gmail.com
Fri Jun 10 10:49:11 PDT 2011


On Jun 11, 11 01:41, Andrej Mitrovic wrote:
> On 6/10/11, Andrei Alexandrescu<SeeWebsiteForEmail at erdani.org>  wrote:
>> Without the cast, writeln prints "yes" or "no", which may be desirable.
>> If you want to print the bool, you can say
>>
>> writeln(keepTerminator == Flag!"KeepTerminator".yes);
>>
>> or
>>
>> writeln(!!keepTerminator);
>>
>
> Oh, maybe this was already incorporated into format but I didn't
> nocie, I just did a blunt copy/paste of the template code so it didn't
> work for me:
> D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\format.d(1624): Error:
> template std.format.formatValue(Writer,T,Char) if (is(const(T) ==
> const(void[]))) formatValue(Writer,T,Char) if (is(const(T) ==
> const(void[]))) matches more than one template declaration,
> D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\format.d(895):formatValue(Writer,T,Char)
> if (is(T == enum)) and
> D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\format.d(1104):formatValue(Writer,T,Char)
> if
> (is(T : bool))

Try to use the Phobos on git master. I have fixed this already (bug 
5837) and the patch has been merged on June 3rd.


More information about the Digitalmars-d mailing list