Tree-based set. More...
#include <DynamicSet.h>
Public Types | |
using | const_iterator = typename TreeType::const_iterator |
Public Member Functions | |
constexpr | DynamicSet ()=default |
Dynamic set. | |
template<template< typename, size_t > class ArrayType, size_t size> | |
constexpr | DynamicSet (const ArrayType< T, size > &items) |
Constructor from existing ordered data. More... | |
PURITY_WEAK constexpr bool | contains (const T &item) const |
Check if the set contains an element. More... | |
constexpr void | insert (const T &item) |
Insertion an element into the set. More... | |
PURITY_WEAK constexpr Optional < const T & > | getOption (const T &item) const |
constexpr void | clear () |
Remove all elements of the set. | |
PURITY_WEAK constexpr const_iterator | begin () const |
PURITY_WEAK constexpr const_iterator | end () const |
PURITY_WEAK constexpr size_t | size () const |
PURITY_WEAK constexpr bool | operator== (const DynamicSet &other) const |
PURITY_WEAK constexpr bool | operator!= (const DynamicSet &other) const |
PURITY_WEAK constexpr bool | operator< (const DynamicSet &other) const |
PURITY_WEAK constexpr bool | operator> (const DynamicSet &other) const |
Private Types | |
using | TreeType = BTree< T, 3, nItems, LessThanPredicate, EqualityPredicate > |
Private Attributes | |
TreeType | tree_ |
Tree-based set.
T | Value type of the set |
nItems | Maximum number of items to store in the set |
LessThanPredicate |
|
inline |
Constructor from existing ordered data.
Warning: These constructors expect ordered arrays!
|
inline |
Check if the set contains an element.
Complexity \(\Theta(N \log N)\)
|
inline |
Insertion an element into the set.
Complexity \(\Theta(N \log N)\)