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

int iteration = 10;
int WARN_GJK_ITERATIONS = 10;

static assert (is(typeof({
cpAssertWarn(iteration < WARN_GJK_ITERATIONS,
            "iteration < WARN_GJK_ITERATIONS");

cpAssertWarn(iteration < WARN_GJK_ITERATIONS,
            "iteration < WARN_GJK_ITERATIONS",
    "High GJK iterations: %d", iteration);
}())));

Meta