Search code examples
c++standardsassertdefensive-programmingc++20

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?


Solution

  • 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.