bool <=> int. WTF. (DIP0015)
Patrick Schluter
Patrick.Schluter at bbox.fr
Thu Jul 4 16:31:11 UTC 2019
On Thursday, 4 July 2019 at 15:30:59 UTC, wjoe wrote:
[snip good arguments]
> or even better - the C way. Is it 0, or else...
> This is completely predictable unlike the bool b = void; can be
> true and false at the same time.
that's the issue. D's bool type follows exactly C (C has bool
since C99) and C++ way. bool b; will behave exactly like your
bool b = void;
>
> The whole point of a Boolean data type is that it's something
> in its own right and decoupled from the implementation.
> Otherwise it's a redundancy.
>
> But then, IMHO, Boolean is almost always best to be replaced by
> something more expressive like std.typecons.Flag
>
> On that note if there's something that can be removed from the
> D language, it's bool.
Nope.
More information about the Digitalmars-d
mailing list