|
|
|
| |||||
|
|
| ||||||
|
|
|||||||
|
|
home translate to German (by SYSTRAN)
|
|
|
Static AssertionsSee Proposal to Add Static Assertions to the Core (Revision 3)
template<class T>
struct A {
static const int val = sizeof(T);
static_assert(val != 0, "message");
};
static_assert(true, "message");
namespace ns {
static_assert(1 + 1 == 2, "message");
}
struct B {
static_assert(true, "message");
};
int main() {
static_assert(A<char>::val == sizeof(char), "message");
return 0;
}
| |||
This Web page is licensed under the Creative Commons Attribution - NonCommercial - Share Alike License. Any use is subject to the Privacy Policy.
|
Revision: 1.1, http://cmeerw.org/prog/freecpp/static_assertions.html Last modified: Mon May 16 12:40:10 2005 |
Christof Meerwald <cmeerw@cmeerw.org> XMPP: cmeerw@cmeerw.org |