With the expression
(void)var;
we can effectively disable unused variable warnings.
However, how does that work with arguments in a parameter pack?
template<bool Debug = DebugMode, typename... Arg>
void log_debug(const Arg&... args) {
if constexpr(Debug) {
(std::clog << ... << args) << std::endl;
} else {
//ignore the arguments willingly when not in debug
(void)args; // does not compile
}
}