Static Assertion / Compile-Time Assertion

This page answers questions like these:

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:
Difference Between char* and char [] and char s[n]
Difference Between char* s = "string"; and char s[] = "string";
What is TCP Keep Alive?
How to Use TCP Keep Alive?

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


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

Src: code-static-assertion.txt
Dst: C++-C/static-assertion-compile-time-assertion.htm
Ads: 2