3#include "DSCEngine/types/hash.hpp"
5#include "DSCEngine/debug/assert.hpp"
9 template<
typename T,
int (*H)(const T&) = default_hash<T, 128>,
int S = 128>
15 void add(
const T& item);
16 void remove(
const T& item);
17 bool includes(
const T& item)
const;
20 template<
typename T,
int (*H)(const T&),
int S>
24 nds_assert(0<=h && h<S);
27 for(
int i=0;i<container[h].size() && !found;i++)
28 found = (container[h][i]==item);
31 container[h].push_back(item);
34 template<
typename T,
int (*H)(const T&),
int S>
35 void HashSet<T,H,S>::remove(
const T& item)
38 nds_assert(0<=h && h<S);
39 container[h].remove(item);
42 template<
typename T,
int (*H)(const T&),
int S>
43 bool HashSet<T,H,S>::includes(
const T& item)
const
46 nds_assert(0<=h && h<S);
48 for(
int i=0;i<container[h].size();i++)
49 if(container[h][i]==item)
Definition: hash_set.hpp:11
Generic dynamic vector.
Definition: vector.hpp:23
Generic dynamic vector definition.