can anyone explain me the working of this debugging template

Revision en1, by Rinnegan77, 2020-07-24 06:17:16

***************************************************************************************** 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


Tags #debug, _debug, #c++ template, c++ 14, c++17

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Rinnegan77 2020-07-24 06:17:16 566 Initial revision (published)