diff options
author | Colin Snover | 2017-10-05 20:32:16 -0500 |
---|---|---|
committer | Colin Snover | 2017-10-06 22:10:49 -0500 |
commit | 5e2e6e9e8a06a3a54e74b889d167a094d74f5d5a (patch) | |
tree | cc9ff512b5f4046999f5c5c1cbc15dd69c58a610 | |
parent | 6723bed162d3c64fd274146d83009744b3701a69 (diff) | |
download | scummvm-rg350-5e2e6e9e8a06a3a54e74b889d167a094d74f5d5a.tar.gz scummvm-rg350-5e2e6e9e8a06a3a54e74b889d167a094d74f5d5a.tar.bz2 scummvm-rg350-5e2e6e9e8a06a3a54e74b889d167a094d74f5d5a.zip |
COMMON: Switch to compile-time checking of invalid SortedArray calls
Runtime error detection is error-prone and unnecessary.
-rw-r--r-- | common/array.h | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/common/array.h b/common/array.h index bb7e03c4f7..1645db05b1 100644 --- a/common/array.h +++ b/common/array.h @@ -418,31 +418,19 @@ public: Array<T>::insert(where, element); } - T &operator[](size_type idx) { - error("Operation []= not allowed with SortedArray"); - } +private: + T &operator[](size_type idx); - void insert_at(size_type idx, const T &element) { - error("Operation insert_at(idx, element) not allowed with SortedArray"); - } + void insert_at(size_type idx, const T &element); - void insert_at(size_type idx, const Array<T> &array) { - error("Operation insert_at(idx, array) not allowed with SortedArray"); - } + void insert_at(size_type idx, const Array<T> &array); - void insert(iterator pos, const T &element) { - error("Operation insert(pos, elemnet) not allowed with SortedArray"); - } + void insert(iterator pos, const T &element); - void push_back(const T &element) { - error("Operation push_back(element) not allowed with SortedArray"); - } + void push_back(const T &element); - void push_back(const Array<T> &array) { - error("Operation push_back(array) not allowed with SortedArray"); - } + void push_back(const Array<T> &array); -private: // Based on code Copyright (C) 2008-2009 Ksplice, Inc. // Author: Tim Abbott <tabbott@ksplice.com> // Licensed under GPLv2+ @@ -465,7 +453,6 @@ private: return &this->_storage[start_]; } -private: int (*_comparator)(const void *, const void *); }; |