aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/defs.hh
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetLib/src/defs.hh')
-rw-r--r--Carpet/CarpetLib/src/defs.hh11
1 files changed, 11 insertions, 0 deletions
diff --git a/Carpet/CarpetLib/src/defs.hh b/Carpet/CarpetLib/src/defs.hh
index 3ae0b8261..afbabfba5 100644
--- a/Carpet/CarpetLib/src/defs.hh
+++ b/Carpet/CarpetLib/src/defs.hh
@@ -36,6 +36,17 @@ using namespace std;
+// Use this macro AT instead of vector's operator[] or at().
+// Depending on the macro NDEBUG, this macro AT either checks for
+// valid indices or not.
+#ifndef NDEBUG
+# define AT(index) at(index)
+#else
+# define AT(index) operator[](index)
+#endif
+
+
+
// Begin a new line without flushing the output buffer
char const * const eol = "\n";