29 template<
typename Value,
typename HashFunctions,
typename Traits>
class HashSet;
30 template<
typename Value,
typename HashFunctions,
typename Traits>
35 template<typename ValueArg, typename HashArg = typename DefaultHash<ValueArg>::Hash,
38 typedef HashArg HashFunctions;
39 typedef TraitsArg ValueTraits;
72 template<
typename T,
typename HashTranslator>
iterator find(
const T&);
74 template<
typename T,
typename HashTranslator>
bool contains(
const T&)
const;
86 template<
typename T,
typename HashTranslator> pair<iterator, bool>
add(
const T&);
93 friend void deleteAllValues<>(
const HashSet&);
99 static const T&
extract(
const T& t) {
return t; }
102 template<
typename ValueType,
typename ValueTraits,
typename T,
typename Translator>
104 static unsigned hash(
const T& key) {
return Translator::hash(key); }
105 static bool equal(
const ValueType& a,
const T& b) {
return Translator::equal(a, b); }
106 static void translate(ValueType& location,
const T& key,
const T&,
unsigned hashCode)
108 Translator::translate(location, key, hashCode);
112 template<
typename T,
typename U,
typename V>
115 m_impl.swap(other.m_impl);
118 template<
typename T,
typename U,
typename V>
121 return m_impl.size();
124 template<
typename T,
typename U,
typename V>
127 return m_impl.capacity();
130 template<
typename T,
typename U,
typename V>
133 return m_impl.isEmpty();
136 template<
typename T,
typename U,
typename V>
139 return m_impl.begin();
142 template<
typename T,
typename U,
typename V>
148 template<
typename T,
typename U,
typename V>
151 return m_impl.begin();
154 template<
typename T,
typename U,
typename V>
160 template<
typename T,
typename U,
typename V>
163 return m_impl.find(value);
166 template<
typename T,
typename U,
typename V>
169 return m_impl.find(value);
172 template<
typename T,
typename U,
typename V>
175 return m_impl.contains(value);
178 template<
typename Value,
typename HashFunctions,
typename Traits>
179 template<
typename T,
typename Translator>
184 return m_impl.template find<T, Adapter>(value);
187 template<
typename Value,
typename HashFunctions,
typename Traits>
188 template<
typename T,
typename Translator>
193 return m_impl.template find<T, Adapter>(value);
196 template<
typename Value,
typename HashFunctions,
typename Traits>
197 template<
typename T,
typename Translator>
201 return m_impl.template contains<T, Adapter>(value);
204 template<
typename T,
typename U,
typename V>
207 return m_impl.add(value);
210 template<
typename Value,
typename HashFunctions,
typename Traits>
211 template<
typename T,
typename Translator>
212 pair<typename HashSet<Value, HashFunctions, Traits>::iterator,
bool>
216 return m_impl.template addPassingHashCode<T, T, Adapter>(value, value);
219 template<
typename T,
typename U,
typename V>
222 if (it.
m_impl == m_impl.end())
224 m_impl.checkTableConsistency();
225 m_impl.removeWithoutEntryConsistencyCheck(it.
m_impl);
228 template<
typename T,
typename U,
typename V>
234 template<
typename T,
typename U,
typename V>
240 template<
typename ValueType,
typename HashTableType>
243 typedef typename HashTableType::const_iterator iterator;
244 iterator end = collection.end();
245 for (iterator it = collection.begin(); it != end; ++it)
249 template<
typename T,
typename U,
typename V>
252 deleteAllValues<typename HashSet<T, U, V>::ValueType>(collection.m_impl);
255 template<
typename T,
typename U,
typename V,
typename W>
260 vector.resize(collection.
size());
262 iterator it = collection.
begin();
263 iterator end = collection.
end();
264 for (
unsigned i = 0; it != end; ++it, ++i)