39# ifndef TPL_DYNARRAY_SET_H
40# define TPL_DYNARRAY_SET_H
70 template <
typename T,
class Equal = Aleph::equal_to<T>>
134 return &this->
append(item);
140 return &this->
append(std::forward<T>(item));
149 for (
size_t i = 0; i < this->
size(); ++i)
167 return search(key) !=
nullptr;
191 size_t count(
const T & key)
const noexcept
194 for (
size_t i = 0; i < this->
size(); ++i)
222 for (
size_t i = 0; i < this->
size();)
Exception handling system with formatted messages for Aleph-w.
#define ah_domain_error_if(C)
Throws std::domain_error if condition holds.
Set-like container backed by a dynamic array.
const T & find(const T &key) const
DynArray_Set(Equal __eq, size_t _pow_dir, size_t _pow_seg, size_t _pow_block)
Construct a set using custom DynArray layout parameters and a custom equality predicate.
size_t count(const T &key) const noexcept
Count how many occurrences of key exist.
DynArray_Set(Equal __eq, const size_t dim)
Construct a set with a given initial dimension using a custom equality predicate.
T & find(const T &key)
Find and return a reference to the first matching element.
T * insert(const T &item)
Insert item (duplicates are allowed).
bool remove_one(const T &key)
Remove a single occurrence of key.
size_t remove_all(const T &key)
Remove all occurrences of key.
T * search(const T &key) noexcept
Search for the first element equal to key.
DynArray_Set(Equal __eq)
Construct an empty set using a custom equality predicate.
bool contains(const T &key) const noexcept
Check whether key is present.
const Equal & get_equal() const noexcept
Return the equality predicate used by this container.
const T * search(const T &key) const noexcept
void set_equal(Equal __eq)
Replace the equality predicate used by this container.
void remove(T &item)
Given a valid reference to an item in the array, it removes it and decrease the dimension.
size_t size() const noexcept
Return the current dimension of array.
T & access(const size_t i) const noexcept
Fast access without checking allocation and bound_min_clock checking.
T & append()
Allocate a new entry to the end of array.
__gmp_expr< typename __gmp_resolve_expr< T, V >::value_type, __gmp_binary_expr< __gmp_expr< T, U >, __gmp_expr< V, W >, __gmp_dim_function > > dim(const __gmp_expr< T, U > &expr1, const __gmp_expr< V, W > &expr2)
Main namespace for Aleph-w library functions.
std::decay_t< typename HeadC::Item_Type > T
DynList< T > maps(const C &c, Op op)
Classic map operation.
Lazy and scalable dynamic array implementation.
Comprehensive sorting algorithms and search utilities for Aleph-w.