Date: Mon, 12 May 2025 22:00:36 +0200
Perhaps distinguishing f and &f?
-----Ursprüngliche Nachricht-----
Von:Frederick Virchanza Gotham via Std-Proposals <std-proposals_at_[hidden]>
Gesendet:Mo 12.05.2025 21:40
Betreff:Re: [std-proposals] comparison between pointers and bool
An:std-proposals_at_[hidden];
CC:Frederick Virchanza Gotham <cauldwell.thomas_at_[hidden]>;
On Monday, May 12, 2025, Tymi via Std-Proposals <std-proposals_at_[hidden] <mailto:std-proposals_at_[hidden]> > wrote:
I think pointer == bool should be permitted
For instance
`if (myPointer == false) throw nullptr;`
Tymi.
Sort of half-related to this, I don't think that function pointers should implicitly convert to bool. I chased a bug recently:
assert( wxIsMainThread );
which should have been:
assert( wxIsMainThread() );
I would be in favour of the deprecation of implicit conversion of a function pointer to bool -- although maybe that would break too much code.
--
Std-Proposals mailing list
Std-Proposals_at_[hidden]
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-05-12 20:07:48