This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

compile time assert

Does anyone know how to write a compiletime ASSERT?

If the condition is true, then don't generate any code. If it is false, then does #error Assert Failed to stop compilation.

Thanks,

Anh

Something like this:

if (condition)
{
}
else
{
#error Assert Failed
}

0