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?
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?
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.
The new use of
assert
won't cause any problems, because it is not followed by a(
and therefore the function-style macroassert(blah)
won't be invoked.