XIEITE_DEBUG

Defined in header <xieite/pp/debug.hpp>

Detects the presence of platform-specific macros indicating debug mode: DEBUG, NDEBUG, _DEBUG, and QT_DEBUG.


Definition

#define XIEITE_DEBUG /* boolean integer literal */


Example

int add(int a, int b) {
	if constexpr (XIEITE_DEBUG) {
		std::println("DEBUG: {} + {}", a, b);
	}
	return a + b;
}

int main() {
	int sum = add(1, 2);
	std::println("LOG: {}", sum);
}
Possible output:
DEBUG: 1 + 2
LOG: 3
[View in Compiler Explorer]