Static Assertion / Compile-Time Assertion

This page answers questions like these:


Related Links:
Boost Token Iterator Assertion Failed
Difference Between char* and char [] and char s[n]
Difference Between char* s = "string"; and char s[] = "string";
What Is TCP KeepAlive?
How To Use TCP KeepAlive?



How to do a Compile-Time / Static Assertion in C++ or C?

/* ** Static Assertion Macro: ** Example Usage: STATIC_ASSERT(sizeof(int) == 4, int_is_not_size_4); */ #define STATIC_ASSERT(condition, name) typedef int name[(condition) ? 1 : -1]


Related Links:
Boost Token Iterator Assertion Failed
Difference Between char* and char [] and char s[n]
Difference Between char* s = "string"; and char s[] = "string";
What Is TCP KeepAlive?
How To Use TCP KeepAlive?

Home  >  C++ / C  >  Static Assertion / Compile-Time Assertion


Tags: static assertion, compile-time assertion, C++, C

Copyright © HelpDoco.com
code-static-assertion.txt
C++-C/static-assertion-compile-time-assertion.htm
1