summaryrefslogtreecommitdiff
path: root/src/utils.hh
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2013-01-31 18:58:25 +0100
committerMaxime Coste <frrrwww@gmail.com>2013-01-31 18:58:25 +0100
commitedef8e4e981c8bcacf9a611ce6859af5f5c1f2b1 (patch)
treea963903a48ef4a1350f8bbf8bd8f625f19fd8a94 /src/utils.hh
parent7f02ef334f00ef00afeef2ebd6e6d73f87d70d63 (diff)
Remove Set and use unordered_set
Diffstat (limited to 'src/utils.hh')
-rw-r--r--src/utils.hh36
1 files changed, 0 insertions, 36 deletions
diff --git a/src/utils.hh b/src/utils.hh
index f9e72703..1e20ff34 100644
--- a/src/utils.hh
+++ b/src/utils.hh
@@ -207,42 +207,6 @@ const T& clamp(const T& val, const T& min, const T& max)
return (val < min ? min : (val > max ? max : val));
}
-// *** set ***
-// generic simple set based on vector
-
-template<typename T>
-class Set
-{
-public:
- using iterator = typename std::vector<T>::iterator;
- using const_iterator = typename std::vector<T>::const_iterator;
-
- void add(T value)
- {
- assert(not contains(m_values, value));
- m_values.push_back(value);
- }
-
- void remove(T value)
- {
- auto it = find(m_values, value);
- assert(it != m_values.end());
- m_values.erase(it);
- }
-
- size_t size() const { return m_values.size(); }
- bool empty() const { return m_values.empty(); }
-
- iterator begin() { return m_values.begin(); }
- iterator end() { return m_values.end(); }
-
- const_iterator begin() const { return m_values.begin(); }
- const_iterator end() const { return m_values.end(); }
-
-private:
- std::vector<T> m_values;
-};
-
}
#endif // utils_hh_INCLUDED