Browse Source

static_assert is available in C++11 and C11

Compliant c++ compilers define __cplusplus to a long integer depending on
the version of C++:

  * C++ pre-C++98 - `1`
  * C++98 - `19971L`
  * C++11 - `201103L`
  * C++14 - `201402L`

Any compiler that states that it is C++11 compilant should have
static_assert available

C compilers define __STDC_VERSION__ to:

  * C89 - `1` (but not always defined)
  * C94 - `199409L`
  * C99 - `199901L`
  * C11 - `201112L`

C11 has the _Static_assert keyword
Matt Clarkson 10 years ago
parent
commit
82b5698e43

Diff Data Not Available.