4 ms·
I don't think so, but for zero-cost logging you just need the conditional for your branch to be constexpr. If the branch is known not to be taken at compile tim
by justbuchanan 8y ago
I don't think so, but for zero-cost logging you just need the conditional for your branch to be constexpr. If the branch is known not to be taken at compile time, the compiler can just throw it away.
Something like:
void MyDebugLog(text) {
if (<constepxr check if logging enabled>) {
// actually log...
}
}