// the find
sharkdp/dbg-macro
A dbg(…) macro for C++
A single-header C++ macro that prints expression names, values, types, file/line/function context, and colorized output — inspired by Rust's dbg!(). Drop it anywhere you'd write printf-debugging, and it passes through the value so it works inline inside expressions. Aimed at C++ developers who want fast-turnaround debugging without a full debugger session.
The expression-passthrough design is the killer feature — wrapping a subexpression in dbg() doesn't break the surrounding code, you just get output as a side effect. Type printing is genuinely useful, especially for template code where you'd otherwise have to instantiate a type-display hack yourself. The compiler warning on include is a smart safeguard against shipping debug output to production. Multiple format helpers (hex, oct, bin, type<T>(), time()) cover the common cases without inventing a DSL.
The installation story for teams is friction — 'copy to /usr/local/include' is fine for personal machines but doesn't scale, and while vcpkg/CMake FetchContent options exist, they're buried. No support for wide strings or wchar_t output, which will surprise Windows developers working with Win32 APIs. The customization hook (operator<<) is the same one your logging and serialization already use, so you can't have different dbg vs. production output formatting without more boilerplate. Last meaningful activity is a few months old and the issue tracker has open bugs; it's effectively maintenance-mode.