From 2b82da0e695a422775b0850f5f14e56f80f41cfa Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Sat, 3 Feb 2007 20:58:00 +0000 Subject: CarpetLib: Use AT to index std::vector Define a macro AT() to index into std::vector. Depending on the macro NDEBUG, AT() is defined either as at(), providing index checking, or as operator[], providing no checking. darcs-hash:20070203205854-dae7b-a1999c88c95ba12b1ee66505f712aefdd67d7e6f.gz --- Carpet/CarpetLib/src/gf.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Carpet/CarpetLib/src/gf.cc') diff --git a/Carpet/CarpetLib/src/gf.cc b/Carpet/CarpetLib/src/gf.cc index 26fa00f38..50bb0f661 100644 --- a/Carpet/CarpetLib/src/gf.cc +++ b/Carpet/CarpetLib/src/gf.cc @@ -58,7 +58,7 @@ const data* gf::operator() (int tl, int rl, int c, int ml) const assert (c>=0 and c=0 and ml=0 and tl*)storage.at(ml).at(rl).at(c).at(tl); + return (const data*)storage.AT(ml).AT(rl).AT(c).AT(tl); } template @@ -68,7 +68,7 @@ data* gf::operator() (int tl, int rl, int c, int ml) assert (c>=0 and c=0 and ml=0 and tl*)storage.at(ml).at(rl).at(c).at(tl); + return (data*)storage.AT(ml).AT(rl).AT(c).AT(tl); } -- cgit v1.2.3