4

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?

xmllmx
  • 39,765
  • 26
  • 162
  • 323

2 Answers2

14

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.

user10383261
  • 141
  • 2
7

The new use of assert won't cause any problems, because it is not followed by a ( and therefore the function-style macro assert(blah) won't be invoked.

user253751
  • 57,427
  • 7
  • 48
  • 90