int main() { char cstr[] = "Hello, World!"; int i = 5; int *pi = &i; std::cout << debug_rep(std::string(cstr)) << std::endl; std::cout << debug_rep(cstr) << std::endl; std::cout << debug_rep(pi) << std::endl; return 0; }
std::string debug_rep(T *p) { std::ostringstream ret; ret << "pointer: " << p; if (p) ret << " " << debug_rep(*p); else ret << " null pointer"; return ret.str(); }
std::string debug_rep(const char *p) { return debug_rep(std::string(p)); }
std::ostream& errorMsg(std::ostream& os, const Args... rest) { // print(os, debug_rep(rest)...); return print(os, debug_rep(rest)...); }