...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Table 36.1. Test programs provided with static_assert
Test Program |
Expected to Compile |
Description |
---|---|---|
Platform dependent. |
Namespace scope test program, may compile depending upon the platform. |
|
Yes |
Function scope test program. |
|
Yes |
Class scope test program. |
|
Yes |
Illustrates usage, and should always compile, really just tests compiler compatibility. |
|
No |
Illustrates failure at namespace scope. |
|
No |
Illustrates failure at non-template function scope. |
|
No |
Illustrates failure at non-template class scope. |
|
No |
Illustrates failure at non-template class scope. |
|
No |
Illustrates failure at template class scope. |
|
No |
Illustrates failure at template class member function scope. |
|
No |
Illustrates failure of class scope example. |
|
No |
Illustrates failure of function scope example. |
|
No |
Illustrates failure of function scope example (part 2). |