can anyone explain me the working of this debugging template

Правка en1, от 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


Теги #debug, _debug, #c++ template, c++ 14, c++17

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Rinnegan77 2020-07-24 06:17:16 566 Initial revision (published)