gcc - How to print input c++ function parameter values automatically -
I was wondering if there is a macro or standard way (for debugging purposes) to automatically print the value of the parameter Function F, such as to show values of If there is no such magic in a standard way, is it possible to write a macro / template to do this? - Update - Copy @ xxh, it is impossible to print inside the function in question: it is possible to automate it on the macro / template, collar side: < / P> which prints each parameter value, and Thank you PS I am using GCC, (and also lying in the future). Take it on me: Output: Various templates are fun! __ function___ function shows signature / print for? For example,
void foo (int x, string y) {cout & lt; & Lt; __FUNCTIION_ARGS__ & lt; & Lt; Endl; }
x and
y .
call (foo, x, y);
foo (x, y) as as it directly identifies every other aspect ? If a value is not printable (such as pointers, functions), wrapper
calls can only print an opaque value such as
& lt; Ptr & gt; or
& lt; Noprint & gt; .
#include
Ultimate: Hello 3.14 42 Hello 3.14 42 57
Comments
Post a Comment