Not only static_check in Loki static_check.h, there is a static_size_assert.
I have always ignored this static_size_assert, and now I suddenly discovered that it can be written almost anywhere in the code, and Static_Check can only be placed in the function. Imitation static_size_assert also implements static_check that can be placed in any place is not difficult.
Loki makes such a choice, I think it should be like this to bring extra MSG information. For small items, it can be more tempting to anywhere than with extra information.
Template
// # define STATIC_CHECK (expr) do {CompileTimeError <(expr)> STATIC_CHECK_ERROR; (void) STATIC_CHECK_ERROR;} while (0) #define STATIC_CHECK (expr) typedef static_assert_test
Because it is engaged in embedded system development, I always want to know the size of a structure at any time. If you want to run a schedule, it is too much trouble. So, think of using the stuff to print it out in the compile period. Unfortunately, this is achieved by generating compilation errors, I can't implement this function without affecting normal compilation.
#define static_size_trace (type) / template