For a while now I've been doing this when I want to check the input of a function (in this example, to make sure they are not equal).
void foo(int a, int b)
{
assert(a != b);
}
But when the assert fails, I always find my self changing it to
void foo(int a, int b)
{
if(a != b)
{
cout << "a: " << a << " b: " << b << endl;
exit(0);
}
}
Is there a reason that I shouldn't just do this in the first place?
Thanks,
Dave