DMD can implicitly convert class pointer to the bool. Is it bug or terrible feature?

ilya-stromberg ilya-stromberg-2009 at yandex.ru
Sun Nov 24 06:55:09 PST 2013


On Sunday, 24 November 2013 at 14:45:31 UTC, Maxim Fomin wrote:
> Because '!' operator provides boolean context.

Yes, but it's ambiguously. What should compiler to use:
1) pointer comparing `is null` or
2) bool comparing `cast(bool)`

What happens if `cast(bool)` operator will be added or removed?


More information about the Digitalmars-d mailing list