C++ Logo

std-proposals

Advanced search

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

From: Alejandro Colomar <une+cxx_std-proposals_at_[hidden]>
Date: Mon, 20 Apr 2026 17:25:41 +0200
Hi,

On 2026-04-20T20:00:44+0500, Muneem via Std-Proposals wrote:
> Relying on external tools for reporting errors is always unreliable.

Why would clang-tidy(1) be unrealiable??

> What
> one would need is standard adapter. Using macros or external tools for
> something as simple as an adaptor should be avoided. Until c++ provides
> adaptors, I would say make it yourself. It's simple:
> 1.that is to make an adaptor where you make all default copy constructors
> and copy assignment operators explicit.
> 2.provide a conversion operators to bool that returns the underlying bool
> 3. constructor that takes a bool argument and constructs the underlying
> bool.
> Problem fixed, right?
> No need for macros.

No, thanks. Overloading operators is something you will never see me
doing.

As Ville said, there's std::same_as<>.


Cheers,
Alex

-- 
<https://www.alejandro-colomar.es>

Received on 2026-04-20 15:25:57