I'm basically looking for a way to automate typing stuff like the following:
cout << "a[" << x << "][" << y << "] =\t" << a[x][y] << endl;
Something like:
PRINTDBG(a[x][y]);
Ideally this would also work for
PRINTDBG(func(arg1, arg2));
and even
PRINTDBG(if(condition) func(foo););
(which would print e.g. "if(false) func(5)").
Nonportable hacks welcome too :)
(no, using a debugger isn't the same, it's much less flexible and I find it confusing)