Hey!  Poor old not-equals is like "what am I? chopped liver?"

    auto x = (2 != 0);

In fact many languages do not allow "conversion" of a number to boolean.  If you want a condition that is the number is not zero then you simply say just that.

On Fri, Aug 7, 2020 at 4:46 AM Matthew Woehlke via Std-Discussion <std-discussion@lists.isocpp.org> wrote:
On 06/08/2020 11.30, Florian Weimer via Std-Discussion wrote:
> I don't think there is another meaningful way to get an int into a bool.

   auto x = static_cast<bool>(2);
   auto x = !!2;
   auto x = (2 ? true : false);

I don't see the problem here; `bool{2}` is invalid (narrowing) for the
same reason `char{65536}` is invalid. (Numerically speaking, the set of
values which `bool` can represent is {0, 1}.)

Std-Discussion mailing list