Presentation Draft

closed account (3hM2Nwbp)
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)

http://www.scribd.com/doc/207063552/Modern-C-Static-Assertions

Particularly, I'm looking for more use-cases. From my experience, nothing beats live working real world examples.

Thanks

* by the way, I mean suggestions in content I already know my artistic ability suffers.
Last edited on
There is a grammatical error on the third slide.
preprocessing happens before in a stage before compilation starts
Last edited on
closed account (3hM2Nwbp)
It astounds me how oblivious humans are to their own errors. I read that slide dozens of times without noticing. Thanks for catching it for me.
static_assert(__cplusplus >= 201103L, "A C++11 compiler is required to compile this!");
funny


> I already know my artistic ability suffers.
then fix that already http://deic.uab.es/~iblanes/beamer_gallery/
closed account (3hM2Nwbp)
@ne555 - Paradoxes enthrall me.

I will be delegating the aesthetics to a friend that is actually qualified to work with such things :)
> 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.


The initial proposal for a language/library feature would include a few use-cases justifying the proposed addition to the standard.
static assertions: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2002/n1381.htm
Topic archived. No new replies allowed.