Perhaps distinguishing f and &f?
 

-----Ursprüngliche Nachricht-----
Von: Frederick Virchanza Gotham via Std-Proposals <std-proposals@lists.isocpp.org>
Gesendet: Mo 12.05.2025 21:40
Betreff: Re: [std-proposals] comparison between pointers and bool
An: std-proposals@lists.isocpp.org;
CC: Frederick Virchanza Gotham <cauldwell.thomas@gmail.com>;


On Monday, May 12, 2025, Tymi via Std-Proposals <std-proposals@lists.isocpp.org> 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@lists.isocpp.org
 https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals