You cannot do this. If you have the following line:
my_assert(a!=b);
The expression a!=b will be evaluated first, and its result will be passed to my_assert .
Assuming your function my_assert() used specifically for your own testing, and you can control how it works and what you go into it, you can do something like this:
my_assert(a!=b, "a!=b");
Ie, pass an additional parameter to the function with a string representation of what is being tested. Obviously, this will not stop you from accidentally saying my_assert(a!=b, "a==b"); and this is awkward, but I can't think of another way to do it.
nnnnnn
source share