diff options
Diffstat (limited to 'impl/IdMap.hpp')
-rw-r--r-- | impl/IdMap.hpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/impl/IdMap.hpp b/impl/IdMap.hpp index b265e37..8cb25f8 100644 --- a/impl/IdMap.hpp +++ b/impl/IdMap.hpp @@ -1,6 +1,7 @@ #ifndef ID_MAP_HPP #define ID_MAP_HPP +#include <cassert> #include <ostream> template<typename T, typename V> @@ -32,15 +33,11 @@ struct IdMap { return *this; } virtual const V& operator[] (const T& x) const { - if (x.id() >= _length) { - throw "Array out of bounds"; - } + assert(x.id() < _length); return _assignment[x.id()]; } virtual V& operator[] (const T& x) { - if (x.id() >= _length) { - throw "Array out of bounds"; - } + assert(x.id() < _length); return _assignment[x.id()]; } |