Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::VectorSet< Value, Container > Struct Template Reference

A set built on an unsorted Vector, ensuring no item duplication. More...

#include <VectorSet.h>

Public Member Functions

auto size () const
 Return size of the set. More...
 
Value * begin ()
 
const Value * begin () const
 
Value * end ()
 
const Value * end () const
 
template<typename ComparableToValue >
bool contains (const ComparableToValue &value)
 Check if the given Value exists in the VectorSet. More...
 
bool insert (const Value &value)
 Inserts a value in the VectorSet (if it doesn't already exists) More...
 
template<typename ComparableToValue >
bool remove (const ComparableToValue &value)
 Removes a value from the VectorSet (if it exists) More...
 

Public Attributes

Container items
 

Detailed Description

template<typename Value, typename Container = SC::Vector<Value>>
struct SC::VectorSet< Value, Container >

A set built on an unsorted Vector, ensuring no item duplication.

Template Parameters
ValueThe contained value
ContainerThe underlying container used

Member Function Documentation

◆ contains()

template<typename Value , typename Container = SC::Vector<Value>>
template<typename ComparableToValue >
bool SC::VectorSet< Value, Container >::contains ( const ComparableToValue &  value)
inline

Check if the given Value exists in the VectorSet.

◆ insert()

template<typename Value , typename Container = SC::Vector<Value>>
bool SC::VectorSet< Value, Container >::insert ( const Value &  value)
inline

Inserts a value in the VectorSet (if it doesn't already exists)

◆ remove()

template<typename Value , typename Container = SC::Vector<Value>>
template<typename ComparableToValue >
bool SC::VectorSet< Value, Container >::remove ( const ComparableToValue &  value)
inline

Removes a value from the VectorSet (if it exists)

◆ size()

template<typename Value , typename Container = SC::Vector<Value>>
auto SC::VectorSet< Value, Container >::size ( ) const
inline

Return size of the set.


The documentation for this struct was generated from the following file: