I'm going to be giving some talks at a university in the near future on some of the more modern C++ artifacts. I've finished an initial draft on static assertions and would like to get some feedback / suggestions.
Vaguely Arranged as:
1) Overview (what is the feature?)
2) History (why was the feature added? What problems does it solve?)
3) Syntax
4) Use Cases (with examples)
> Particularly, I'm looking for more use-cases.
> From my experience, nothing beats live working real world examples.
From Strustrup's FAQ:
1 2 3
static_assert(sizeof(long)>=8, "64-bit code generation required for this library.");
struct S { X m1; Y m2; };
static_assert(sizeof(S)==sizeof(X)+sizeof(Y),"unexpected padding in S");
A static_assert can be useful to make assumptions about a program and its treatment by a compiler explicit.