Should you be able to initialize a float with a char?
deadalnix
deadalnix at gmail.com
Fri May 20 16:56:50 UTC 2022
On Friday, 20 May 2022 at 16:02:15 UTC, Steven Schveighoffer
wrote:
>> It implies all implicit conversions should be removed.
>
> No, not at all. bool can implicitly convert to int, char is
> probably fine also (thinking about the OP of this thread, I'm
> actually coming around to realize, it's not that bad). I don't
> like integers converting *to* bool or char (or dchar, etc).
> That would stop this problem from happening. bool being treated
> as an integral type is suspect.
>
In fact, it doesn't even require implicit conversion to be
removed at all. Matching bool in this case really doesn't make
sense, and even by the letter of the spec I'm not sure this is
right.
Indeed, one of the constructor in an exact match, while the other
is an implicit conversion match.
More information about the Digitalmars-d
mailing list