11#include <initializer_list>
84 d = std::move(
other.d);
190 return d.insert(
value);
199 return d.insert(std::move(
value));
208 return d.erase(
value) > 0;
244 for(
const auto &v :
other.d)
ret.d.insert(v);
255 for(
const auto &v : d) {
268 for(
const auto &v : d) {
292 template <
typename Func>
294 for(
const auto &v : d) func(v);
Dynamic array container wrapping std::vector.
Definition list.h:40
bool contains(const T &val) const
Returns true if the list contains the given value.
Definition list.h:593
void reserve(size_t newCapacity)
Pre-allocates storage for at least newCapacity elements.
Definition list.h:314
void pushToBack(const T &value)
Pushes an item onto the back of the list.
Definition list.h:455
Ordered unique-element container wrapping std::set.
Definition set.h:37
friend bool operator!=(const Set &lhs, const Set &rhs)
Returns true if the sets differ.
Definition set.h:304
ConstIterator end() const noexcept
Returns a const iterator to one past the last element.
Definition set.h:106
bool contains(const T &value) const
Returns true if value exists in the set.
Definition set.h:149
ConstRevIterator constRevEnd() const noexcept
Returns a const reverse iterator to one before the first element.
Definition set.h:136
std::pair< Iterator, bool > insert(T &&value)
Inserts a value into the set (move overload).
Definition set.h:198
ConstRevIterator crbegin() const noexcept
Returns a const reverse iterator to the last element.
Definition set.h:121
Set intersect(const Set &other) const
Returns the intersection of this set and other.
Definition set.h:253
friend bool operator==(const Set &lhs, const Set &rhs)
Returns true if both sets have identical contents.
Definition set.h:301
bool remove(const T &value)
Removes value from the set.
Definition set.h:207
Iterator remove(Iterator pos)
Removes the element at pos.
Definition set.h:216
RevIterator rend() noexcept
Returns a mutable reverse iterator to one before the first element.
Definition set.h:127
Set unite(const Set &other) const
Returns the union of this set and other.
Definition set.h:242
Iterator find(const T &value)
Finds value in the set.
Definition set.h:156
std::set< T > Data
Underlying std::set storage type.
Definition set.h:44
typename Data::const_iterator ConstIterator
Const forward iterator.
Definition set.h:50
typename Data::iterator Iterator
Mutable forward iterator.
Definition set.h:47
~Set()=default
Destructor.
ConstRevIterator crend() const noexcept
Returns a const reverse iterator to one before the first element.
Definition set.h:133
Set & operator=(const Set &other)
Copy assignment operator.
Definition set.h:77
RevIterator revEnd() noexcept
Returns a mutable reverse iterator to one before the first element.
Definition set.h:130
ConstIterator constEnd() const noexcept
Returns a const iterator to one past the last element.
Definition set.h:112
Set(Set &&other) noexcept
Move constructor.
Definition set.h:65
ConstIterator find(const T &value) const
Const overload of find().
Definition set.h:159
ConstRevIterator constRevBegin() const noexcept
Returns a const reverse iterator to the last element.
Definition set.h:124
bool isEmpty() const noexcept
Returns true if the set has no elements.
Definition set.h:141
List< T > toList() const
Converts the set to a List.
Definition set.h:280
ConstIterator lowerBound(const T &value) const
Const overload of lowerBound().
Definition set.h:169
void clear() noexcept
Removes all elements.
Definition set.h:221
std::pair< Iterator, bool > insert(const T &value)
Inserts a value into the set.
Definition set.h:189
ConstIterator begin() const noexcept
Returns a const iterator to the first element.
Definition set.h:94
ConstIterator cbegin() const noexcept
Returns a const iterator to the first element.
Definition set.h:97
void swap(Set &other) noexcept
Swaps contents with another set.
Definition set.h:230
RevIterator rbegin() noexcept
Returns a mutable reverse iterator to the last element.
Definition set.h:115
Set subtract(const Set &other) const
Returns this set minus other.
Definition set.h:266
ConstIterator constBegin() const noexcept
Returns a const iterator to the first element.
Definition set.h:100
Set & operator=(Set &&other) noexcept
Move assignment operator.
Definition set.h:83
ConstIterator upperBound(const T &value) const
Const overload of upperBound().
Definition set.h:179
Set(const Set &other)
Copy constructor.
Definition set.h:62
size_t size() const noexcept
Returns the number of elements.
Definition set.h:144
ConstIterator cend() const noexcept
Returns a const iterator to one past the last element.
Definition set.h:109
typename Data::reverse_iterator RevIterator
Mutable reverse iterator.
Definition set.h:53
Iterator begin() noexcept
Returns a mutable iterator to the first element.
Definition set.h:91
RevIterator revBegin() noexcept
Returns a mutable reverse iterator to the last element.
Definition set.h:118
Set(std::initializer_list< T > initList)
Constructs a set from an initializer list.
Definition set.h:71
Set()=default
Default constructor. Creates an empty set.
Iterator end() noexcept
Returns a mutable iterator to one past the last element.
Definition set.h:103
typename Data::const_reverse_iterator ConstRevIterator
Const reverse iterator.
Definition set.h:56
Iterator upperBound(const T &value)
Returns an iterator to the first element greater than value.
Definition set.h:176
Iterator lowerBound(const T &value)
Returns an iterator to the first element not less than value.
Definition set.h:166
void forEach(Func &&func) const
Calls func for every element.
Definition set.h:293
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19
const T & value(const Result< T > &r)
Returns the value from a Result.
Definition result.h:56
#define PROMEKI_SHARED_FINAL(TYPE)
Macro for non-polymorphic native shared objects.
Definition sharedptr.h:88