4#include "../Containers/Vector.h"
8template <
typename Value,
typename Container>
18template <
typename Value,
typename Container = SC::Vector<Value>>
24 auto size()
const {
return items.size(); }
26 [[nodiscard]] Value* begin() {
return items.begin(); }
27 [[nodiscard]]
const Value* begin()
const {
return items.begin(); }
28 [[nodiscard]] Value* end() {
return items.end(); }
29 [[nodiscard]]
const Value* end()
const {
return items.end(); }
32 template <
typename ComparableToValue>
33 [[nodiscard]]
bool contains(
const ComparableToValue& value)
35 return items.contains(value);
39 [[nodiscard]]
bool insert(
const Value& value)
41 if (items.contains(value))
45 return items.push_back(value);
49 template <
typename ComparableToValue>
50 [[nodiscard]]
bool remove(
const ComparableToValue& value)
52 return items.remove(value);
A set built on an unsorted Vector, ensuring no item duplication.
Definition: VectorSet.h:20
auto size() const
Return size of the set.
Definition: VectorSet.h:24
bool contains(const ComparableToValue &value)
Check if the given Value exists in the VectorSet.
Definition: VectorSet.h:33
bool insert(const Value &value)
Inserts a value in the VectorSet (if it doesn't already exists)
Definition: VectorSet.h:39
bool remove(const ComparableToValue &value)
Removes a value from the VectorSet (if it exists)
Definition: VectorSet.h:50