Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the macro `assert` be removed in C++20?

According to cppreference, assert will be used as a C++ attribute.

However, there already exist tons of projects heavily dependent on the macro assert, is there any bad effect?

like image 789
xmllmx Avatar asked Nov 30 '22 08:11

xmllmx


1 Answers

No. The proposal p0542r5 which introduces C++20 contracts says:

Note that while assert(expression) would expand as a function-like macro with the appropriate header, assert: is not a function-like invocation, so does not expand.

like image 137
user10383261 Avatar answered Dec 04 '22 12:12

user10383261