diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-06-23 09:25:43 +0200 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2009-06-23 09:25:43 +0200 |
commit | 9c4e99c6776437e0d4f7d98296c772c04532b392 (patch) | |
tree | 5ca8a91fc81a68530ff023ab7efcbbd024bf1391 /lout | |
parent | 064a77fb31399521e031b6885f244c23f320baf0 (diff) |
remove BOUND_CHECKING switch in SimpleVector
Bound checking assertions can be switched off with the standard
NDEBUG compile time switch.
Diffstat (limited to 'lout')
-rw-r--r-- | lout/misc.hh | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lout/misc.hh b/lout/misc.hh index 59ada437..f9cb939a 100644 --- a/lout/misc.hh +++ b/lout/misc.hh @@ -77,13 +77,6 @@ public: template <class T> class SimpleVector { private: - enum { - /** - * \brief Edit this for debugging. Should be optimized by the compiler. - */ - BOUND_CHECKING = 1 - }; - T *array; int num, numAlloc; @@ -169,8 +162,7 @@ public: * \sa misc::SimpleVector::get */ inline T* getRef (int i) { - if (BOUND_CHECKING) - assert (i >= 0 && this->num - i > 0); + assert (i >= 0 && this->num - i > 0); return array + i; } @@ -181,8 +173,7 @@ public: * misc::SimpleVector::getRef. */ inline T get (int i) { - if (BOUND_CHECKING) - assert (i >= 0 && this->num - i > 0); + assert (i >= 0 && this->num - i > 0); return this->array[i]; } @@ -195,8 +186,7 @@ public: * be necessary before. */ inline void set (int i, T t) { - if (BOUND_CHECKING) - assert (i >= 0 && this->num - i > 0); + assert (i >= 0 && this->num - i > 0); this->array[i] = t; } }; |