Make enum auto castable

via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Jun 4 20:46:22 PDT 2017


On Sun, Jun 04, 2017 at 08:15:46PM -0700, Jonathan M Davis via Digitalmars-d-learn wrote:
> Well, implicit conversions tend to cause a lot of bugs in C++ code, so
> Walter decided to restrict them quite a bit more in D than they are in C++.

So D has plenty of implicit conversion. It is implicit *construction* that it lacks.

And alas, C++'s mistake is implicit is default, so it gets used in places it wasn't intended. We should have just had explicit default with implicit as an option.




More information about the Digitalmars-d-learn mailing list