aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/defs.hh
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2005-11-19 20:31:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2005-11-19 20:31:00 +0000
commit770244b3441d73fc51de9db18ecdc8f8f4627cd8 (patch)
tree4fdf7ce7f06288650d0a3deb0cc98a10e1090904 /Carpet/CarpetLib/src/defs.hh
parentca6ed49761d44201c851118aecddb7c820f55900 (diff)
CarpetLib: Define macro static_assert()
This macro checks the assertion at compile time instead of at run time. darcs-hash:20051119203134-dae7b-36ab53fbcd87acbd1ebca930e61db47448f4a979.gz
Diffstat (limited to 'Carpet/CarpetLib/src/defs.hh')
-rw-r--r--Carpet/CarpetLib/src/defs.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/defs.hh b/Carpet/CarpetLib/src/defs.hh
index 415a067cc..d486dc0e4 100644
--- a/Carpet/CarpetLib/src/defs.hh
+++ b/Carpet/CarpetLib/src/defs.hh
@@ -24,6 +24,11 @@ using namespace std;
+// A compile time pseudo assert statement
+#define static_assert(_x) do { typedef int ai[(_x) ? 1 : -1]; } while(0)
+
+
+
// Number of dimensions
const int dim = 3;