C++ Logo

std-proposals

Advanced search

Re: P2264 Make assert() macro user friendly for C and C++

From: THOMAS CATALANO tomcatalano.0 gmail account <tomcatalano.0_at_[hidden]>
Date: Tue, 13 Apr 2021 14:56:34 -0400
Edit profile
Dr'THOMAS J CATALANO,PsyD'`Catalano•
@EIN854010832tJc
¡http://github.com/THOMASjosephCa…¿”'`
|Born February 5, ‘1981'|github.com/THOMASjosephCa…Born February 5, 1981Joined January 2016
0 Following
182 Followers
Tweets
Tweets & replies
Media
Likes
🗑Dr'THOMAS J CATALANO,PsyD'`Catalano•’s Tweets

Dr'THOMAS J CATALANO,PsyD'`Catalano•
·
59s
Replying to
@EIN854010832tJc
...while keeping ..nation/states.. dubless at fraudulent/false scientific experimentation all different for deferment of stay...

Dr'THOMAS J CATALANO,PsyD'`Catalano•
·
5m
Replying to
@EIN854010832tJc
&&&the Londen-dungeons oversees caster-vats reproducing “blood&and/or&&dnaDNAdna” of all over&over on a spool so they can claim they are the only ones with the “true bluf” they keaf rule slavery’s posterity...
1

Dr'THOMAS J CATALANO,PsyD'`Catalano•
·
28m
Replying to
@EIN854010832tJc
//\no more blood set they at birth and mandatory photo-identification at birth no more birth-certificate stake!
1

Dr'THOMAS J CATALANO,PsyD'`Catalano•
·
30m
Replying to
@EIN854010832tJc
&&&...and the ENGLANG–clang are playing checkers shate ///procreaters faith by leashing all stay jay and all are gone and one or two etc so forth and they stay they only that resaign witness and play crate
1

Dr'THOMAS J CATALANO,PsyD'`Catalano•
·
1h
¡it’s not the Reese’s-Plates ,,, their the Reeses–Aims!
1
Show this thread
You Retweeted

Dr'THOMAS J CATALANO,PsyD'`Catalano•
·
1h
¡


Sent from my iPhone

> On Apr 8, 2021, at 6:14 AM, via Std-Proposals <std-proposals_at_[hidden]> wrote:
>
> ­­Dear all,
>
> I am somewhat unhappy with P2264R0. Its main goal is to make it more beginner friendly. However, it introduces a pitfall for beginners that is currently not present.
>
> The paper suggests to define basically
> #define assert(...) ((__VA_ARGS__)?(void)0:std::abort())
> Certainly, it makes
> assert(std::is_same::value);
> working as expected, which is good. However, a beginner might think that assert works like static_assert and write
> assert(std::is_same::value, "Different types");
> If P2264R0 gets adopted, this becomes a well-formed. And the assertion will pass since a string literal is not NULL. Currently such a code is ill-formed, which is much better.
>
> An alternative would be to define
> #define assert(...) (bool(__VA_ARGS__)?(void)0:std::abort())
> since a function style cast does not allow a comma operator. In this case,
> assert(std::is_same::value);
> would work as expected and
> assert(std::is_same::value, "Different types");
> would still be ill-formed.
>
> The example from P2264r0
> assert((void)"this cannot be true", -0.0);
> looks like an anti-pattern to me. Particularly after deprecating the comma operator in subscript expressions, it is very odd if it gets newly introduced into the assert macro. If WG21 accepts P2264r0 as-is into the standard and if programmers start using this comma operator trick (since it would be an allowed use), the above-mentioned pitfall will be stuck in the language forever.
>
> PS: I have tried to post this e-mail some time ago, but apparently there was a problem.
>
> Best regards,
> Stefan
>
>
>
> Ihr Recht auf Privatsphäre. Schützen Sie Ihre Daten und wechseln jetzt zu eclipso Mail & Cloud.
>
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2021-04-13 13:56:49