C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Unary operator | (absolute value of)

From: Rik van der Brugghen <potideluxe_at_[hidden]>
Date: Fri, 24 Nov 2023 12:12:48 +0100
Hi.

Well, I knew this was not going to be nr1 on the todo list :-) But I
appreciate the feedback!

I am old time C guy, so I didnt even know about spaceship <=>, but indeed
very handy, just as strcmp ().

Also, i would definitely not like unicode involved, please keep plain ascii.

And within double v.bar like |a| not either, it was really supposed to
work exactly like ~a.

About a | | b (space inbetween) vs a || b .
Is it really so that C is in all circumstances space agnostic except for
literal strings?

I tried with a && b vs a & & b, but the comp said you cant do bitwise and
with a right operand which is an addr (unless you cast it). So the space
makes a difference, but already at the compile stage :-)

Anyway, abs (x) it will be...

Enjoy the weekend!

Received on 2023-11-24 11:13:02