38#include <gtest/gtest.h>
51 bool operator()(
int a,
int b)
const noexcept
53 auto aa = a < 0 ? -a : a;
54 auto bb = b < 0 ? -b : b;
63 bool operator()(
int a,
int b)
const noexcept
181 auto *p = s.search(10);
197 s.set_equal(ModEqual{11});
Set-like container backed by a dynamic array.
size_t count(const T &key) const noexcept
Count how many occurrences of key exist.
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.
bool contains(const T &key) const noexcept
Check whether key is present.
void remove(T &item)
Given a valid reference to an item in the array, it removes it and decrease the dimension.
T & get_last() const
Return a modifiable reference to the last item of array (as if this was a queue)
T & get_first() const
Return a modifiable reference to the first item of array (as if this was a queue)
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.
bool is_empty() const noexcept
Return true if the array is empty.
Main namespace for Aleph-w library functions.
DynList< T > maps(const C &c, Op op)
Classic map operation.
double mod(double a, double b)