diff options
author | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 11:45:31 +1100 |
---|---|---|
committer | Carlo Zancanaro <carlo@pc-4w14-0.cs.usyd.edu.au> | 2012-10-15 11:45:31 +1100 |
commit | a7c69ec12aec23036bfdb6447e7c38b001a40f3d (patch) | |
tree | 03d7fc971195d623ff35e9f01773ae95bbe9a688 /impl/IdMap.hpp | |
parent | bb9a899b7c45b830c6b70e2811130a41ebb31ee5 (diff) |
Fix up to build with clang (and fix another bug)
- Remove exceptions
- Remove dynamic casts
The bug was relating to MaxStrategy not cleaning up the influence sets
after propagating changes. I just added a call to .clear() and it seems
fine.
Diffstat (limited to 'impl/IdMap.hpp')
-rw-r--r-- | impl/IdMap.hpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/impl/IdMap.hpp b/impl/IdMap.hpp index 27c0806..ed0723e 100644 --- a/impl/IdMap.hpp +++ b/impl/IdMap.hpp @@ -32,17 +32,11 @@ struct IdMap { return *this; } virtual const V& operator[] (const T& x) const { - if (x.id() >= _length) { - std::cout << "throw exception" << *(char*)NULL; - //throw "Array out of bounds"; - } + assert(x.id() < _length); return _assignment[x.id()]; } virtual V& operator[] (const T& x) { - if (x.id() >= _length) { - std::cout << "throw exception" << *(char*)NULL; - //throw "Array out of bounds"; - } + assert(x.id() < _length); return _assignment[x.id()]; } |