Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
STD_NOTHROW.cpp
Go to the documentation of this file.
1// checking for std::nothrow
2
3
26// will fail if namespaces aren't supported
27namespace std {
28
29struct nothrow_t { };
30
31extern const nothrow_t nothrow;
32
33} // std
34
35
36// force a failure by using the same name for an object of a diferent
37// type than std:nothrow_t if namespace std isn't honored
38const std::nothrow_t *nothrow = &std::nothrow;
39
40
41int main (int argc, char *argv[])
42{
43 (void)&argv;
44
45 // foil clever optimizers
46 if (argc > 2)
47 nothrow = 0;
48
49 // will fail at link-time if std::nothrow is not defined
50 // in the compiler support library
51 return !(0 != nothrow);
52}
#define main
const nothrow_t nothrow
const std::nothrow_t * nothrow
Definition json.h:5363