Debuging not working

Revision en1, by Bryma, 2020-12-14 17:44:35

Hi ! I have a problem with debug in c++. I'm using this —

void DBG() { cerr << "]" << endl; } template<class H, class... T> void DBG(H h, T... t) { cerr << to_string(h); if(sizeof...(t)) cerr << ", "; DBG(t...); }

ifdef _DEBUG

define dbg(...) cerr << "LINE(" << LINE << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)

else

define dbg(...) 0

endif

When i type for example — int a = 5; dbg(a);

It's not showing any output.

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Bryma 2020-12-14 17:44:35 510 Initial revision (published)