C++ Logo

std-proposals

Advanced search

Re: [std-proposals] comparison between pointers and bool

From: Muneem <itfllow123_at_[hidden]>
Date: Mon, 20 Apr 2026 18:09:58 +0500
You have a point but the issue does exist that bools are too lose to be
used in interfaces. It's like if int/double was too lose, like it is bad
but the fixes are fairly simple: a standard bool adaptor or "explicit
function arguments"

On Mon, 20 Apr 2026, 6:04 pm Giuseppe D'Angelo via Std-Proposals, <
std-proposals_at_[hidden]> wrote:

> Il 20/04/26 14:52, sasho648 via Std-Proposals ha scritto:
> > And the topic is - should converson from pointer to bool like this be
> > allowed.
>
> What do you mean, should it be allowed? It *is* allowed and it's
> well-formed code. Do you mean, should it be disallowed?
>
> I have to be honest her, as much as it is a good idea, in a language
> without epochs, that's never going to happen. Your best shot is to ask
> compiler vendors to implement this as a warning and turn it on. Clang
> already has it (for string literals to bool), and clang-tidy has one for
> pointers to bool.
>
> HTH,
> --
> Giuseppe D'Angelo
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
>

Received on 2026-04-20 13:10:12