sharkdp/dbg-macro
View on GitHub ↗ ★ 3,235 C++
A dbg(…) macro for C++
6 mentions on Hacker News by 4 people: 2 stories, 4 comments · first 2019-09-21 · latest 2023-09-30
20082026
-
▲ 2
Dbg() – A macro for printf-style debugging fansstory by jandeboevrie · 2023-09-30 · 0 comments
-
…of the critical comments here are missing that that's probably the intended use-case of this. [1] https://github.com/sharkdp/dbg-macro
comment by izoow · 2023-09-30 · in Show HN: A C++ dump func. that can print multi-D vectors, maps, tuples, and all -
Thank you for the feedback. No, it does not evaluate its argument twice - see this test: https://github.com/sharkdp/dbg-macro/blob/f30cdda9fc5332e062...
comment by sharkdp · 2019-09-21 · in Show HN: A dbg(...) macro for C++ -
Thank you for the feedback. We deliberately chose not to do this (see discussion in https://github.com/sharkdp/dbg-macro/issues/26 ), mainly for the reasons given in the Rust documentation: > The dbg! macro works exactly the same in…
comment by sharkdp · 2019-09-21 · in Show HN: A dbg(...) macro for C++ -
…offer runtime enable/disable. Out of curiosity, I wrote a little benchmark and submitted as a PR: https://github.com/sharkdp/dbg-macro/pull/57 The key idea is that modern CPUs dynamically branch-predict-away if-statements that are…
comment by asah · 2019-09-21 · in Show HN: A dbg(...) macro for C++ -
▲ 162
Show HN: A dbg(...) macro for C++story by sharkdp · 2019-09-21 · 51 comments