cpAssertWarn

If the CHIP_ENABLE_WARNINGS version is set, print a warning to stderr if condition is false.

void
cpAssertWarn
(
string file = __FILE__
size_t line = __LINE__
E
Args...
)
(
lazy E condition
,
lazy string expr
,
lazy Args args
)

Examples

1 int iteration = 10;
2 int WARN_GJK_ITERATIONS = 10;
3 
4 static assert (is(typeof({
5 cpAssertWarn(iteration < WARN_GJK_ITERATIONS,
6             "iteration < WARN_GJK_ITERATIONS");
7 
8 cpAssertWarn(iteration < WARN_GJK_ITERATIONS,
9             "iteration < WARN_GJK_ITERATIONS",
10     "High GJK iterations: %d", iteration);
11 }())));

Meta