bool <=> int. WTF. (DIP0015)

Daniel Kozak kozzi11 at
Wed Sep 18 08:13:24 UTC 2019

On Wed, Sep 18, 2019 at 10:06 AM Daniel Kozak <kozzi11 at> wrote:
> You can do this on your own, just make your own Boolean type, or it
> could be added to Phobos, in theory it is there already:

import std.stdio;
import std.typecons;
alias MyBool = Flag!"mybool";
alias True = Flag!"mybool".yes;
alias False = Flag!"mybool".no;

void main()
    MyBool a = True;

More information about the Digitalmars-d mailing list