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