10#include "../defines.h"
11#include "./iteratorUtils.h"
15 template <
int N,
typename T =
int>
21 PONCA_MULTIARCH_STD_MATH(
abs);
22 return (
abs(
_x) * 2654435761u) %
N;
52 template <
int N,
typename T =
int,
template <
int,
typename>
typename _HashFunctor = HashDefaultFunctor>
55 static_assert(
N > 0,
"The capacity must be strictly positive");
80 constexpr PONCA_MULTIARCH
HashSet() : m_data()
83 if constexpr (EMPTY != T(0))
93 PONCA_MULTIARCH
void clear();
117 static constexpr T OFFSET =
119 static constexpr T EMPTY = T(0);
124#include "./hashset.hpp"
Aggregator class used to declare specialized structures using CRTP.
Stores unique signed integer values in a contiguous array.
bool insert(int _value)
Tries to insert a value in the HashSet.
bool search(int _value, int &_searchedIdx) const
Search for a value in the HashSet.
bool contains(int _value) const
Tries to find a value in the HashSet.
void clear()
Empty the array.
void fill(ForwardIt first, ForwardIt last, const T &value)
Assigns the given value to all elements in the range [first, last).
This Source Code Form is subject to the terms of the Mozilla Public License, v.
static constexpr T hash(const int _x)
The default hashing function : (abs(x) * 2654435761u) % N.